February 2008 Entries
Deploying Visual Studio DSL Packages to Users Without the VS SDK Installed

For other people to be able to use your DSL packages without having to install the VS SDK themselves, you will need to get a Package Load Key (PLK) and install it into the DSL package. 

To simulate the project running on a machine without the SDK installed (thereby replicating the issue), add the "/novsip" to the command line arguments for the debug project.   E.g:    /ranu /rootsuffix Exp /novsip /DesignTimeRun "..\..\..\Debugging\Debugging.sln"

If you now run your DSL project in the experimental hive, you should experience a 'Package Load Failure' - this is exactly what others will get due to not having the SDK installed.

 

To Obtain and install a PLK

  • Visit: http://www.vsipmembers.com/
  • Sign up if you are not already a member.
  • Click "Request a Package Load Key"
  • Create a new 'Product'.  The information on the next page must exactly match the same parameters in your DslDefinition.dsl file.
  • Once the product is created you can request a PLK.
  • Copy the PLK value, and paste it into a new value (e.g. 500) in VSPackage.resx in your package project.
  • Add the following custom attribute to the Package.tt file (the < > tokens should be replaced with those supplied in earlier steps: 

    [VSShell::ProvideLoadKey("<minimum edition> ", "<product version>", "<product name>", "<company name>", <PLK resource value>)]

  • Tranform the Package.tt template.
  • Re-run the package (with /novsip switch) and ensure there is no 'Package Load Failure' - if this is successful, then the package should workon any machine that does not have the VS SDK installed.

 

Visual Studio Extensibility Solutions on a Build Server

When configuring a build server to build VSX projects, you may encounter the error:  Failed to retrieve paths under VSTemplate for the specified registry hive.

To get around this you need to 'reset the experimental hive' (found under VS 2008 SDK in the start menu) for the account used by the build agent.  You will not encounter this issue on your local machine as Visual Studio automatically sets up the hive when authoring a VSX solution.

Making Visual Studio Build Events behave as though executed from the Visual Studio Command Prompt

If you want all the PATHs you see can from the Visual Studio Command Prompt within a pre/post build event, then stick the following at the top of your build event:

For VS 2005: 

CALL "%VS80COMNTOOLS%vsvars32.bat"

For VS 2008: 

CALL "%VS90COMNTOOLS%vsvars32.bat"

 

This is particulary useful if you are trying to call gacutil or regasm.