Saturday, September 18, 2010

Building Silverlight projects on a 64bit build server

If you are building Silverlight projects on the ISOAPP502 build server, it’s possible that the build will fail with following error:

C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.Common.targets (101): The Silverlight 3 SDK is not installed.

C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.Common.targets (101): The Silverlight 3 SDK is not installed.

C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Silverlight.Common.targets (104): The Silverlight 4 SDK is not installed.

C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Silverlight.Common.targets (104): The Silverlight 4 SDK is not installed.

At first you should think that the SDK wasn’t installed on the build server. But connecting to the build server confirmed that the SDK was available.

The reason of the failure had to be found somewhere else. It is caused by the fact that the new build engine runs by default in a 64bit process. As Silverlight applications only support 32bit, you’ll have to update your build definition.

Therefore:

  1. Open Team Explorer 2010
  2. Open the Builds section on your Team Project.
  3. Right click on the build definition and choose Edit Build Definition.
  4. In the Build Definition go to the Process tab.
  5. Click Advanced and change the MsBuild Platform option from Auto to X86.

3 comments:

Karl Z said...

I'm still trying to let this soak in... So does that mean that I can't use the Silverlight 4 Assembly Portability approach if my WPF application is intended to run Any CPU (x64)?

Ismail Degani said...

Thanks, you've saved me hours of hair pulling!

Anonymous said...

@Karl it would just run MSBuild as x86. Does not affect AnyCPU compiled binaries from running as x64 or x86 on respective environments.