Mittwoch, 1. Dezember 2010

Hosting Silverlight Application with RIA Services as Cloud Service

We have an existing web project (Silverlight 4, WCF RIA Services) that we wanted to bring to the cloud using Windows Azure.  We added a new project, Windows Azure Cloud Service and added a new Web Role.  After this you can connect your existing web project to this web role. The isolated web project compiles fine, but our new solution brings the following compile error:

    “Error      1             The "CreateRiaClientFilesTask" task failed unexpectedly.System.Web.HttpException (0x80004005): Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format. ---> System.Configuration.ConfigurationErrorsException: Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format. ---> System.BadImageFormatException: Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.”

Strange, what happens and what can we do?

The solution is very easy, but hard to find out: You have to unload your .web project (which hosts the Silverlight application) and edit it the project file.  If you now remove the tags

    <PlatformTarget>AnyCPU</PlatformTarget>
from the project file, your solution can be compiled !

Keine Kommentare:

Kommentar veröffentlichen