-
There are many different ways to manage add-ins. Below are some common add-in management styles which can be used alone, combined, or used side by side. 1) Basic: all interactions between the host and add-ins are executed in the Startup and Shutdown methods of the add-in. This is demonstrated in the...
-
As mentioned in Gary's blog Dependent Assembly Binding Redirect (by version) , it is possible to use a configuration file to change which version of an assembly to use. This can be very helpful in "tight versioning" scenarios (see blog Proxy Versioning Options for Project Templates ) where...
-
As previously noted the isDirty property of a project is for “Microsoft Internal Use Only” and does not actually return valid information. Instead you can determine this by querying for unsaved ProjectItems. The property MacroProjectSaved below demonstrates how to do this. Additional code...
-
A useful function the DTE has a built in is to prompt the user to save any unsaved files. It is a good idea to make this call in when shutting down the DTE, for example in the disconnect method of the VstaDesignTimeIntegration class. EnvDTE. vsPromptResult promptResult = this .dte.ItemOperations.PromptToSave;...
-
When an event will be fired many times it is a good practice to do periodic garbage collection. When a VSTA add-in hooks into an event which is fired many times this becomes even more important because the memory usage for the host process will grow very high without periodic garbage collection. The...
-
The ItemTemplatesLocation entry in the VSTA host configuration hive is used to specify the location of item templates which will only be available through the VSTA host they are registered under. This is different than the VSItemTemplatesLocation entry which is used to specify the location of item templates...
-
Within a VSTA project there is a Host Item Node. This displays in the Project Explorer as a subfolder within the VSTA project and contains the main code file as well as any DPM files. By default the folder's name is the HostID and the icon is the open or closed folder icon. These settings can be...
-
To avoid losing an event hook-up from a COM source it is necessary to hold a local reference to the source of the event to avoid unwanted garbage collection. This is a concern for VSTA hosts hooking into DTE events as well as VSTA add-ins which use a direct reference to a COM host instead of a proxy...
-
A new sample and video are available which demonstrate packaging a VSTA add-in within a document using System.IO.Packaging. Packaging is also used by Office 2007 documents including the "docx", "docm", "xlsx", and "xlsm" file types. In this sample, both the add...
-
VSTA v 2.0 add-ins use two mechanisms to associate add-ins with proxy assemblies. These include the Global Assembly Cache (GAC) and the VSTA pipeline . Each has separate considerations to take into account when naming your proxy assembly. The Global Assembly Cache (GAC) and Add-in Projects The proxy...
-
In many situations you want to add background code to a project template without exposing it to the end user. An easy way to do this is to add a hidden code file to the template. Here are the 6 steps to do this which are the same for both C# and VB templates: 1) Unzip the existing project template. 2...
-
A new sample " UpgradeHelper Sample " is available showing how to register and use an UpgradeHelper . Excerpt: To support VSTA v 1 projects in VSTA v 2 you need to create and register an UpgradeHelper . This helper is triggered when a VSTA v 1 project is opened in the VSTA v 2 IDE. If VSTA...
-
I posted a new sample today which goes with my previous blog. This sample demonstrates many of the host Application, hostID, proxy and entry point combiniations outlined in the Application, HostID, Proxy, and EntryPoint Associations blog. If there is another combination you are interested in or if you...
-
There are a variety of configurations possible between host applications, hostID's, proxies, and entry points. Which configuration to use is a design decision which requires careful consideration, especially if you are deploying multiple applications bundled together or one application targeted at...
-
UPDATE: For an updated version of this code which determines if the project is dirty and uses the DTE to prompt the user to save the project, see the blog: How to Determine if a Project isDirty . You may wish to monitor a user’s actions in the IDE and respond to or cancel them. I found a great...