VSTA Integration

Latest post 12-27-2006 9:16 PM by Gary. 7 replies.
  • 12-11-2006 9:48 AM

    VSTA Integration

    Hello All!

    Who tried to create its own project solution and integtate it with VSTA? Can you describe me your steps?

  • 12-12-2006 11:36 PM In reply to

    Re: VSTA Integration

    Mustafin Artur:

    Hello All!

    Who tried to create its own project solution and integtate it with VSTA? Can you describe me your steps?

    OK, I tried the manual

    "Walkthrough: Integrating VSTA using a managed VSTAHookup Assembly" and have some questions about the code:

    1. Why you did not include tutorial about using another tool - ProjectGen?

    2. Why command

    ProxyGen.exe

    /l:"%APPPATH%\<YourAppTypeLibrary>"

    /h:"%APPPATH%\VSTAHookup\VSTAHookup\Tim.cs"

    /i:"%APPPATH%\\%PROXYPATH%\descriptor.xml"

    /f

    is not working for me, saying that it is some errors corresponding to location of descriptor.xml:

    D:\(skipped due to internationalization)\Visual Studio 2005\Projects\Kernel2>proxygen

    /l:Kernel2.DataWrapper\bin\Debug\Kernel2.Proxy.tlb

    /h:Kernel2.VSTA\TypeInfrastructureManager.cs

    /i:Kernel2.Proxy\descriptor.xml

    /f

    ProxyGen.exe : ProxyGen.exe [Version 8.0.50727.146]
    c Microsoft Corporation. All rights reserved.

    An unrecoverable error was encountered during processing.
    Could not find a part of the path 'D:\(skipped due to internationalization)\Visual Studio 2005\Projects\Kernel2\Kernel2.Proxy\descriptor.xml'.
    This may have been caused by earlier errors.

    ProxyGen.exe Information: 0 : Finished

    3. Where to find more detailed description where to find substitution strings at code like this:

    1
    2
    3
    4
    5
            #region Static Definitions

    static String mHostItemProviderClass = "NameSpace.AddInEntryPointClass";

    #endregion

    4. What to do with these string constants? Are they freely modifiable? Did this info really needed at ProjectGen tool inside project generation process steps? What happens with host, assembly or VSTA integration if that info are occasionally mismatched or mispelled in somewhere?

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
            #region Static Definitions

    static String mAppContextName = @"Application";
    static String mHostID = @"App";
    static string mAppAddInPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"App\AppAddIns");
    static VstaHelper mSingleton;
    static string mMacroProjectFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"App\Macros\AppMacros.csproj");

    static string mMacroProjectPath = Path.GetDirectoryName(mMacroProjectFilePath);
    static string mMacroAddInPath = Path.Combine(mMacroProjectPath, @"bin\debug");
    static string mMacroContextName = @"Macros";
    static string mMacroAssemblyName = @"AppMacros.dll";
    static string mAppAddInTemplateName = @"App Add-in.zip";
    static string mAppAddInTemplateType = @"CSharp";

    #endregion

     

    5. to be continued...

  • 12-13-2006 9:19 AM In reply to

    • Gary
    • Top 10 Contributor
    • Joined on 07-13-2006
    • Posts 307

    Re: VSTA Integration

    Hello Mustafin Artur

    1. Here's an excerpt on ProjectGen cut from our VBA walkthrough...(just use your app name instead of ShapeAppVBA)

    Creating the ShapeAppVBA Project Templates

    Once you have registered the host application, added the proxy assembly to the global assembly cache, and suppressed the runtime exceptions, you can successfully load the ProjectGen.exe wizard that will guide you through the creation of the project templates.

     

    To run the ProjectGen.exe Wizard

    1.        Open the Visual Studio 2005 Command Prompt, and change the path to x:\ProjectGen\x86.

    2.        Execute the following command:

    ProjectGen.exe

     

    There are four pages in the Project Template Wizard that must be completed before you can continue. The following sections describe the values for each of the fields on each page in the wizard. The first page is the Specify Template Properties page.

     

    To complete the Specify Template Properties page

    1.        In the Template name field, type ShapeAppVBA Add-in. This specifies the name of the add-in displayed on the Templates pane of the New Project dialog.

    2.        In the Template description field, type A project for creating add-ins for ShapeAppVBA. This description will appear above the Name box of the New Project dialog whenever the associated template is selected.

    3.        In the Default project name field, type ShapeAppVBA. This name will be used as the default project name that appears in the New Project dialog box. An incremental number is appended to this name for each project created.

    4.        In the Template icon box, click the ellipsis (…) button and navigate to the %SYSTEMDRIVE%\Program Files\Microsoft Visual Studio 8\Common7\IDE\Extensibility Projects\Visual Studio Add-In.ico. This is the icon that will appear in the Templates pane on the New Project dialog.

    5.        In the Host identifier list, select ShapeAppVBA. If successfully registered, ShapeAppVBA will automatically be added to this list of available host identifiers.

    6.        Click Next to continue to the next page of the wizard.

    The next page is the Specify Host Item page.

     

    To complete the Specify Host Item page

    1.        In the Proxy assembly name field, click the ellipsis (…) button and navigate to the %SHAPEAPPVBA%\ShapeAppVBAProxy\bin\Debug\ShapeAppVBA.Proxy.Dll proxy assembly.

    2.        In the Base type list, select ShapeAppVBA.Application.

    3.        In the Host item name field, type ThisApplication. This name is used to determine the name of the code file. For example, ThisApplication.cs and ThisApplication.vb.

    4.        Leave the remaining fields empty, and click Next to continue to the next page of the wizard.

    The next page is the Specify Project Properties page.

     

    To complete the Specify Project Properties page

    1.        In the Debug exe field, click the ellipsis (…) button and navigate to the %SHAPEAPPVBA%\Debug\ShapeAppVBA.exe application.

    2.        Leave the remaining fields empty, and click Next to continue to the next page of the wizard.

    The next page is the Generate Project Template page.

     

    To complete the Generate Project Template page

    1.        Check the Create project template box, if not already checked, and then click the ellipsis (…) button and navigate to the %SHAPEAPPVBA%\Templates directory.

    2.        Check the Register template with host application box, if not already checked.

    3.        Check the Save project template descriptor file box, if not already checked, and then click the ellipsis (…) button and navigate to the %SHAPEAPPVBA% directory, and name the file ShapeAppVBADescriptor.xml.

    4.        Click Finish to complete the wizard.

    5.        Click OK on the Registering Project Templates dialog, after the templates have been successfully registered.

    Now that the project templates have been created, you can test to see that they are accessible from within Visual Studio Tools for Applications.

     

    To test the ShapeAppVBA project templates

    1.        Open the Visual Studio 2005 Command Prompt, and change the path to %SYSTEMDRIVE%\Program Files\Microsoft Visual Studio 8\Common7\IDE.

    2.        Execute the following command:

    vsta /hostid ShapeAppVBA

    3.        On the File menu, click New Project.

    4.        In the Project Types pane, select the Visual C# node.

    5.        In the Templates pane, select ShapeAppVBA Add-in, and click OK.

    6.        Verify that the ShapeAppVBA Add-in project opens in the Visual Studio Tools for Applications IDE.

     

    2. ProxyGen error:   I suspect that this is a localization/internationalization problem. Please send along your exact syntax and your full path.  Then we will reproduce this and report it as a proxygen bug to Microsoft.  

    Workaround:

    a.  Can you add the path to proygen.exe into your environment path, so that it is available in any folder location) from the commandline without specifying a path?   like this:

    C:> ProxyGen

    b.  Next, can you go to the proxy folder for your integration and use local paths for proxygen from the commandline?  This will remove the full path syntax from your proxygen usage and should give you success. 

    3.  You can read about HostItemProvider in VSTA help documentation that comes with VSTA.  Can you find the Visual Studio SDK in the filter list you MS Document Explorer?  The HostItemProvider, is the root of your addin's object model. (ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.VSSDK.v80/dv_vstasdk/html/2abcfef0-409d-4787-8fb2-38472f86ed05.htm).  There needs to be a root or entrypoint specified for the addin's view of your application object (ie: what shows up in object browser and in intellisense while writing macro)

    4.  These strings are used by Host app and ProjectGen for the project Template to load macros and addins.  They need to match each other, or the macro/addin/template will not load.  This will be obvious at runtime

    5.  I hope these answers have been helpful.  Please continue to  send along your questions.

    -Gary

  • 12-14-2006 1:05 AM In reply to

    Re: VSTA Intergration

    Hi, phank you for all your help, but I got a serious trouble lanching VSTA Help.

    Before I get this issue, I had all Visual Studio SDKs installed on host machine. Actually, I had all-in-one system, including VS2005 Enterprise/Developer/Tester/Architector/Premier Partner Editions, Visual Source Safe 2005, MSDN Library 2005, Virtual Server 2005 R2, VSTO, VSTA, NF3.0, WPF, VS2005 Extension for WPF, ODP for .NET 2.0, Oracle Developers Tools VS2005 10.2, IE7, VS2005 Team Explorer, Microsoft Espression Desighn, SQL Server 2005 Enterprise, e.t.c.

    I'm a Pro Developer, and started to

    I did not expect that something is working as not expected except VSTA and VSTA docs.

    I deinstalled all VS SDK, VSTA, VSTO, all documentation libraries, it makes my tiers running on my heart :~(.

    Then, sadly deoptimized, I started WinXP SP2 Corporate with installed VSTA on my Virtual Server 2005, and got the amasing result:

    It works! But what about programming topics?

    They are missed! At All!

  • 12-15-2006 2:22 AM In reply to

    Re: VSTA Intergration

    Mustafin Artur:

    Hello All!

    Who tried to create its own project solution and integtate it with VSTA? Can you describe me your steps?

    All welcome to my Windows Live! Blog .NET Tips and Tricks

    Great respect to Summit for the cool C# code colorizer module!

     

  • 12-19-2006 8:45 AM In reply to

    • Gary
    • Top 10 Contributor
    • Joined on 07-13-2006
    • Posts 307

    Re: VSTA Intergration

    Hello Mustafin Artur,

    For the help documentation problem, we have found that uninstalling all versions of the VS SDK, re-installing the August 06, VS SDK and then installing VSTA removes the naming collision with the help document URLs.  After following these steps, the help documentation URLs should all work.

    To learn how to integrating VSTA, please follow the walkthrough steps using the shape app sample.  When you have done this successfully, you should be ready to integrate VSTA with your own application assemblies. 

    Whenever you have a question about the walkthrough or your own integration of VSTA, let us know what your specific question is and we will find the answer for you or help you determine the answer.

    -Gary

     

    Filed under:
  • 12-23-2006 1:36 AM In reply to

    Re: VSTA Intergration

    I badly damaged my VS 2005 Documetation, MSDN Documentation, all documentation. Luckily, installing an VS 2005 SDK on my VM was successful. It's a bed idea, but currently I'm work within VM using August 2006 Documentation installed on a clean machine.

    Your way of uninstalling all SDK's didnot helped at all. I simply did not see the documentation. I have a Microsoft 2005 Documetation Explorer, MSDN, and tons of other products. I dont want to reinstall all of products becuse of your Help errors.

     

  • 12-27-2006 9:16 PM In reply to

    • Gary
    • Top 10 Contributor
    • Joined on 07-13-2006
    • Posts 307

    Re: VSTA Integration

    Hello Mustafin Artur,

    I understand your difficulty.  We will see if there is an easier way (maybe send you the help doc files) to get the help documentation working on your 'real' machine. 

    Gary

    Filed under: ,
Page 1 of 1 (8 items) | RSS
Copyright Summit Software Company, 2008. All rights reserved.