DSL designers built from migrated beta 2 solutions might have empty toolbox

Context information about the problem

The VSSDK msbuild targets changed between Beta2 and RC so that the <RegisterWithCodebase> msbuild property must be defined before the VSSDK targets are imported, or otherwise, the .pkgdef that is created does not contain a codebase. Since when there is no codebase then the static toolbox loading code is unable to locate the toolbox image resources, the items fail to load, and the toolbox ends up being empty.

In practice: the work-around

First, please know that we'll update the migration tool (%ProgramFiles%\Microsoft Visual Studio 2010 SDK\VisualStudioIntegration\Tools\DSLTools\DslProjectsMigrationTool) for RTM to move the registration related properties so they are defined before the VSSDK targets are imported.

But meanwhile, if you have this problem, you'll need to do the following change manually in the DslPackage.csproj file:

The .csproj snippet below shows how the <RegisterWithCodebase> property was created with Beta 2 (which is now wrong):

   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\VSSDK\Microsoft.VsSDK.targets" />
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\DSLTools\v10.0\Microsoft.DSLTools.targets" />
 
  <!-- Properties for VSSDK/DSL Targets -->
  <PropertyGroup>
    <RegisterOutputPackage>true</RegisterOutputPackage>
    <RegisterWithCodebase>true</RegisterWithCodebase>
    <GacTargetOutput>false</GacTargetOutput>
  </PropertyGroup>

 

Moving the property group above the import elements fixes the problem:

   <!-- Properties for VSSDK/DSL Targets -->
  <PropertyGroup>
    <RegisterOutputPackage>true</RegisterOutputPackage>
     <RegisterWithCodebase>true</RegisterWithCodebase> 
    <GacTargetOutput>false</GacTargetOutput>
  </PropertyGroup>
 
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\VSSDK\Microsoft.VsSDK.targets" />
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\DSLTools\v10.0\Microsoft.DSLTools.targets" />