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 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...