Could not load file or assembly ‘msshrtmi’

Back to my MVC Web Application… After I added a new Windows Azure Cloud Service project to the solution, I could not load the application in debug. A little frustrating, but I figured it out quickly enough. Here is the error:

Server Error in ‘/’ Application.

Could not load file or assembly ‘msshrtmi’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: 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.

It seems that this is a typical error for Azure projects. The odd part was that my Azure project tested successfully, but my web project failed. So I focused on the web project, located the msshrtmi.dll file in the list of dependencies and excluded the file from the project. My problem was that I added the web setup project after the Cloud setup project and included all components. This brought over the Azure specific dll. This fix is not going to work for everyone, but deleting the file solved my problem.

Leave a Reply