Share via


How to Update a Visual Studio 2008 Guidance Package to Visual Studio 2010

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies.
This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Microsoft Visual Studio® 2010 development system and the Guidance Automation Toolkit (GAT) 2010 provide features that let you update guidance packages developed for Visual Studio 2008 so that they will work with Visual Studio 2010. This topic provides detailed instructions for converting, using the GAT to update the package.

Converting the Guidance Package

To convert a Visual Studio 2008 project to a Visual Studio 2010 project

  1. Delete any previous .gpstate file before opening the project in VS 2010

  2. On the Start menu, right-click Microsoft Visual Studio 2010, and then click Run as administrator.

  3. Open the guidance package solution that you want to update. The Visual Studio conversion wizard will appear.

  4. Complete the wizard steps to convert the solution to Visual Studio 2010.

    Note

    Note: You might receive the following error:
    Meta Guidance Package could not be loaded. Do you want to permanently remove the package from the solution?
    Click on NO, and then proceed with the conversion.
    Also, if a popup appears asking you to Retarget a project to .NET Framework 4.0, choose that option and click OK.

Completing the Upgrade of the Guidance Package

To complete the upgrade

  1. On the Visual Studio Tools menu, select Guidance Package Manager, and then click Enable/Disable Packages.

  2. Select Guidance Automation Toolkit, and then click OK to start the GAT.

  3. With the Guidance Package Manager still open, select the UpdateGuidancePackageToVSIX recipe, and then click Execute.

  4. Select the guidance package project that you want to update, and then click Accept. The UpdateGuidancePackageToVSIX recipe will make the following changes to the guidance package project:

    1. Add the VSIX manifest file.
    2. Add the Visual Studio SDK and Guidance Automation Extensions (GAX) targets (MSBuild) to the guidance package project.
    3. Add the template files for VSIX.
    4. Update the Wizard Extension version and the public key token
  5. Wait for the recipe to finish, and then click Close.

  6. After you run the UpdateGuidancePackageToVSIX recipe, check the <WizardExtension> element of each .vstemplate file. The Version should be changed to 2.0.0.0 and PublicKeyToken should be changed to 31bf3856ad364e35. If the values have not been changed, in each .vstemplate, find all instances of the Version and PublicKeyToken in the <WizardExtension> section, and change them to the correct values.

    The final <WizardExtension> section for each .vstemplate should look like the following example.

    <WizardExtension>
    
    <Assembly>
    Microsoft.Practices.RecipeFramework.VisualStudio, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
    </Assembly>
    
    <FullClassName>
    Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate
    </FullClassName>
    
    </WizardExtension>
    

    Note

    Note: You should change the Version and PublicKeyToken in the <WizardExtension> elements. Do not change these values in other elements.

  7. After you update the templates, open the solution, and delete the Installer and Setup projects. For example, if you use the sample included with the GAT, you would delete the GuidancePackageInstaller and GuidancePackageSetUp projects.

  8. Fix the broken references
    Expand References in the solution explorer and delete the following references and add them again from \Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft patterns and practices\GAX 2010\2.0.20406.0\ under either \Program Files\ (32bit VS) or Program Files (x86)\ (64 bit VS)

    1. Microsoft.Practices.Common.dll
    2. Microsoft.Practices.ComponentModel.dll
    3. Microsoft.Practices.RecipeFramework.dll
    4. Microsoft.Practices.RecipeFramework.Common.dll
    5. Microsoft.Practices.RecipeFramework.Library.dll
    6. Microsoft.Practices.RecipeFramework.VisualStudio.dll
    7. Microsoft.Practices.WizardFramework.dll
  9. Open the files in the Actions folder, and replace the base class Action on the class declaration with Microsoft.Practices.RecipeFramework.Action.

  10. Delete the bin and obj folders. Clean the solution. Rebuild the solution.

  11. Go to the \bin\Debug folder of the guidance package project, and verify that the .VSIX file is created.

Debugging the Upgraded Guidance Package

To debug the converted Guidance Package

  1. Reset the Visual Studio 2010 experimental hive as follows:

    1. On the Start menu, select All Programs and then select Microsoft Visual Studio 2010 SDK.
    2. On the Tools menu, select Reset the Microsoft Visual Studio 2010 Experimental Instance.
  2. Configure the debugging setting to start Visual Studio 2010 as an experimental instance. Open the guidance package project Property window, set the debug location to devenv.exe, and set the command line argument to “/rootSuffix Exp”. For more information, see The Experimental Instance of Visual Studio on MSDN (https://msdn.microsoft.com/en-us/library/bb166560(VS.100).aspx).

  3. Clean and rebuild the guidance package solution.

  4. Press Ctrl + F5. This starts an experimental instance of Visual Studio.

  5. In the new instance, on the File menu, select New, and then select Project. Create a project that is the type of the guidance package you just created. You are now ready to execute the guidance package recipes.

    Note

    Note: Some of the recipes might be missing. You can add them by using the AddRecipeReference recipe.

Troubleshooting

You might receive the following error message when you open an old Guidance Package solution containing a web project:

Error HRESULT E_FAIL has been returned from a call to a COM component.

This occurs because the Web site (or other project) points to .NET Framework 2.0.

To resolve this error

  1. Click OK to continue building the solution.
  2. After the solution is created, right-click the Properties of the Web site (or other project), and then change the Target Framework property under the Build tag to point to .NET Framework 4.0.
  3. Save your changes, and build the solution. The solution should now build successfully.