Fixing the Silverlight Design Time in a Windows Azure Cloud Service

This is a workaround for the following configuration:

  • Visual Studio 2008 (works fine on VS 2010)
  • Windows Azure Tools for Microsoft Visual Studio February 2010 Release
  • Silverlight 3 Tools for Visual Studio 2008
  • Building a Silverlight application in a Windows Azure Cloud Service

This is the issue reported in this forum thread.

To reproduce the issue:

1. Create a new Windows Azure Cloud Service project. (File | New Project)

image

2. Add a Web Role to the project, this will be the web application for the Silverlight application.

image

3. Right click on the Solution in Solution Explorer and select “Add |New Project…” Select, a Silverlight Application

image

4. Use an existing web site in the solution to host the Silverlight application.

image 

5. Open up MainPage.xaml and notice that 1. there are no controls on the Toolbox, 2. Intellisense no longer works and 3. pasting in to the XAML editor results in an “Object reference not set to an instance of an object.” error.

image

image

Fixing the issue:

1. Close Visual Studio

2. Save the attached file (Microsoft.CloudService.targets) to your local machine

3. Copy the file to:

  • C:\Program Files (x86)\MSBuild\Microsoft\Cloud Service\v1.0 (64-Bit OS)
  • C:\Program Files\MSBuild\Microsoft\Cloud Service\v1.0  (32-Bit OS)

overwriting the existing file

4. Open Visual Studio, open your Cloud Service and you’ll find you will have the controls on the Toolbox, Intellisense and you can paste in XAML without hitting the Object reference error dialog.

image

This issue will be fixed in our post February 2010 release.

Microsoft.CloudService.targets

Comments

  • Anonymous
    April 22, 2010
    Tons of thanks man. I like your blog content. It is soooo useful. One thing you add here in your blog is the problem and solution related to 'path exceeding 256 charachaters'. There is a USER environment variable you need to set to tell azure dev environment to use shorter temp folder (example: C:A ) instead of default one which is based on user profile.