Azure Deployment Issue after upgrading to Visual Studio 2010 and .NET 4.0
If you have recently upgraded your Web Role project from Visual Studio 2008 to Visual Studio 2010 you may end up experiencing a problem getting your Web Role to startup when you deploy it to Windows Azure.
There are a variety of reasons that your Web Role will not startup properly, however, if you are in this upgrade scenario check the bin of your Web Role project for the msshrtmi.dll. If it exists then you are in luck, because that is likely your issue. For some reason when you upgrade, this file ends up in your bin and therefore gets deployed to Windows Azure. However, if you are developing on a x86 version of Windows (vs x64) then the dll that is in your bin will be the x86 version. Windows Azure is x64 and thus when Azure attempts to startup your Web Role an error such as the following occurs.
Exception message: Could not load file or assembly ‘msshrtmi’ or one of its dependencies. An attempt was made to load a program with an incorrect format.
It took a bit of playing around and comparing of the project files of a brand new Web Role to an upgraded one.
I was told that if I delete all of the bin directories in all of my projects then the file will not get copied. I personally found this to be false, but it may be something that you will want to try. After quite a bit of playing around I found that if I remove the <PlatformTarget> element from the configuration property group in the project file of my web project then the msshrtmi.dll file is not copied to the bin. Hurray!
- Open the web site project file using Notepad.
- Remove the PlatformTarget element from all configuration property groups.
Example Configuration Property Group
<PropertyGroup Condition=” ‘$(Configuration)|$(Platform)’ == ‘Debug|AnyCPU’ “>
If you still are unable to get your Web Role to start I believe you will need to log a case with “Report Live Site Issues” for Windows Azure from the Windows Azure support page. I currently do not know how to view the log files that would provide you the startup errors, which is why you will need to log a case. If anyone knows how to get the startup errors please post a comment or email me.Explore posts in the same categories: Windows Azure
Tags: AzureYou can comment below, or link to this permanent URL from your own site.