Showing related tags and posts accross the entire site.
-
With VSTA v 2 it is possible to use generic parameters of intrinsic types with minimal effort. The example below demonstrates this with a method added to the ShapeApp.Application class which accepts a List<string>. Steps: 1) Create the proxy file ignoring the ProxyGen warnings: ProxyGen.exe Warning...
-
In the proxy file, all types and non-static members in non-classEntryPoint types are marked with a host attribute. The host attributes HostTypeAttribute and HostMemberAttribute are used to reconcile name changes. When there is no name change the attribute is unnecessary. The VSTA runtime uses this attribute...
-
This sample illustrates how to use Tight Versioning to specify which version of the proxy a project template should use. Goal: load add-ins which use a proxy from a previous OM after changing the OM. OM version changes (using same VSTA version): Example- ShapeAppBasicCSharp from VSTA v 2 Object Model...
-
A common question is how to use versioning for the proxy assembly in add-ins. There are basically three different options. (Download Sample) 1) No Versioning: Only the name of the assembly is used in the project template and the first assembly in the GAC matching this name will be used. This is how ProjectGen...
-
A host, or helper application, can programmatically update a reference in a project. One instance where this is useful is when you want to ensure that a specific version of a proxy reference is used. Below is an updated version of the OpenMacroProject from the ShapeAppMacroRecordingCSharp sample which...
-
The sample in this post shows how to support nested types and implicitly declared events in entry point classes (note that the nested type is in the entry point class, but is not an entry point). For types nested in an entry point class, the workaround in Part I is sufficient, no additional changes to...
-
The proxy and host type map provider code files generated by ProxyGen in VSTA v 2 are not indented. Here's an easy fix. 3 ways to fix indentation: 1) Through the menu: Edit -> Advanced -> Format Document 2) Using short cuts: Ctrl + K then Ctrl + D 3) In a macro: DTE.ExecuteCommand("Edit.FormatDocument...
-
Overview: The VSTA v 2 ProxyGen tool creates proxy files designed to work with the updated C# compiler in Visual Studio 2008. It is possible to modify this file to compile with Visual Studio 2005 and we offer a Visual Studio macro to automate these changes. Attached macro: The zip file attached includes...
-
Overview: During development, changes may need to be made to the proxy. Anytime the proxy is changed its assembly needs to be re-installed in the GAC. Failing to do this will result in the last version installed in the GAC to be used by VSTA and the error "The following module was built either with optimizations...
-
You may be asking, "Is this proxy layer stuff really necessary? Why do I have to generate proxy types for all my Object Model objects?" And, "I noticed that System Types like string do not seem to require proxy types, they just work, why is that?" The short answer is: VSTA requires...