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 v 1 is installed, VSTA v 1 projects will still open normally in the VSTA v 1 IDE when doubled clicked. Projects must be opened through the VSTA v 2 IDE to trigger the UpgradeHelper and once upgraded will open in the VSTA v 2 IDE when double clicked.
A couple of notes about using an UpgradeHelper:
1) You must use two unique HostID’s in order to use an UpgradeHelper. Using the same HostID for VSTA v 1 and VSTA v 2 will cause the UpgradeHelper not to be triggered. Related topic: How to Update a Host’s Folder in %My Documents%.
2) In the RemovedReferences section use only the name of the reference to removed- including any other information like the version or public key token will result in the reference not being removed.
3) Only valid projects will trigger the UpgradeHelper. Projects missing the AppAddIn.designer.cs file from the list of compilable files will not trigger the UpgradeHelper.
4) To be sure that the correct version of a reference is added, you may want to use the full GAC information for the reference since you cannot specify SpecificVersion=true. Related topic: Proxy Versioning Options for Project Templates. Example: "ShapeAppCSharpProxy, Version=2.0.0.0, Culture=neutral, PublicKeyToken=3c3c0c46dd27dbcf, processorArchitecture=MSIL"
5) VSTA v 1 projects cannot be opened programmatically through VSTA v 2. Using dte.Solution.AddFromFile or dte.Solution.Open will throw an error if the project has not been previously upgraded. We are looking for a workaround for this (add a comment if you know of one please).
6) The UpgradeHelper is triggered at the end of the normal Visual Studio conversion wizard.
7) The VSTA registries required for the UpgradeHelper are a little tricky- you may want to base yours off the included example
Posted
Dec 04 2008, 02:52 PM
by
Melody