Answered by:
Could not load file or assembly 'msshrtmi, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
Question
-
Hi,
we have ASP.NET MVC 4 project that references Microsoft.WindowsAzure.ServiceRuntime.dll and Microsoft.WindowsAzure.StorageClient.dll from Windows Azure SDK 1.8. After using Visual Studio 2012 to publish the website to the Azure Websites service, the application fails to start with the following error:
Could not load file or assembly 'msshrtmi, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Stack Trace:[FileNotFoundException: Could not load file or assembly 'msshrtmi, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeEnvironment() +0
Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment..cctor() +546
[TypeInitializationException: The type initializer for 'Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment' threw an exception.]
Bzing.Web.Services.AzureServicesSupplier.ProfferServices() in d:\dev\...\AzureServicesSupplier.cs:47
Microsoft.Practices.Web.Modularity.ServiceRegistrar.Register(Object instanceToRegister) in d:\dev\...\ServiceRegistrar.cs:34
Microsoft.Practices.Web.Modularity.BaseRegistrar.RegisterAll(IEnumerable`1 typesToRegister) in d:\dev\...\BaseRegistrar.cs:46
Microsoft.Practices.Web.Modularity.ApplicationBootstrapper.RegisterServices() in d:\dev\...\ApplicationBootstrapper.cs:101
Microsoft.Practices.Web.Modularity.ApplicationBootstrapper.Run() in d:\dev\...\ApplicationBootstrapper.cs:88
Bzing.Web.MvcApplication.Application_Start() in d:\dev\...\Global.asax.cs:25
[HttpException (0x80004005): The type initializer for 'Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment' threw an exception.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9859725
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
[HttpException (0x80004005): The type initializer for 'Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment' threw an exception.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9873912
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
-- Jozef Izso (MCPD)
Tuesday, November 13, 2012 9:33 PM
Answers
-
Hi Jozef,
I can't understand the error message:-). From bing translator, it is "An attempt was made to load a program in the wrong format."
The WAWS site is 32bit, make sure you refrenced the X86 version of msshrtmi.
thanks,
Wei
- Marked as answer by Jozef Izso (WINF) Thursday, November 15, 2012 8:02 PM
Thursday, November 15, 2012 1:53 AM
All replies
-
this is not a build in assembly for WAWS. Referecne 'msshrtmi' in your project, and set reference properties of it(copy to local) to true.
Wednesday, November 14, 2012 8:34 AM -
There's no msshrtmi assembly in the Add Reference dialog.
-- Jozef Izso (MCPD)
Wednesday, November 14, 2012 8:40 AM -
I've added msshrtmi.dll from the Azure SDK 2012-10 and the web project doesn't compile because of this error:
Error : Could not load file or assembly 'msshrtmi' or one of its dependencies. Prebehol pokus načítať program v nesprávnom formáte.
-- Jozef Izso (MCPD)
Wednesday, November 14, 2012 9:55 AM -
Hi Jozef,
I can't understand the error message:-). From bing translator, it is "An attempt was made to load a program in the wrong format."
The WAWS site is 32bit, make sure you refrenced the X86 version of msshrtmi.
thanks,
Wei
- Marked as answer by Jozef Izso (WINF) Thursday, November 15, 2012 8:02 PM
Thursday, November 15, 2012 1:53 AM -
Hi Wei,
referencing the 32-bit version of the msshrtmi assembly solved the problem and the website is running now in the Azure Websites correctly.
Regarding the error message: I have english Windows 8 Pro with english Visual Studio 2010 Professional so I have no idea why the error message is shown in slovak language. But that was the output of the compilator.
Thank you for assistance.
-- Jozef Izso (MCPD)
Thursday, November 15, 2012 8:04 PM