AlfaTeK
AlfaTeK

Reputation: 7765

Could not load file or assembly 'msshrtmi, Version=2.7.0.0 - what SDK installs it?

I'm trying to run an webapp that is using some Azure SDK (and storage) apis but when I try to run it, I always get this runtime error.

I have the project on a Windows 7 box with Visual Studio installed and a bunch of SDKs and it works but on this new Win10 machine I'm starting it doesn't work.

msshrtmi.dll is present on the new machine on C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.9\bin\runtimes\base\x86 (and x64 and in runtimes\net45\base) but on the old machine it is also on c:\windows\Microsoft.net\assembly\GAC_XX\msshrtmi and I can see on IIS that is from it's loaded.

If I manually copy msshrtmi.dll to my bin folder the project works just fine. I also know this file is required form Microsoft.WindowsAzure.ServiceRuntime.

On this new machine I'm trying to avoid installing Visual Studio and using only Jetbrains Rider to build and run the project. It can build the project fine but now it doesn't run because of this.

Does the file really need to be on my windows\microsoft.NET folder? What installer puts it there? Or should I just include msshrtmi.dll as a dependency on my project?

Any other solutions for this problem?

I tried a lot of the solutions on other answers I encountered for this similar problem with no luck.

Edit: tried on ISS express 8 and 10

Upvotes: 1

Views: 1170

Answers (1)

Joey Cai
Joey Cai

Reputation: 20067

There are several possible ways to solve this issue:

1.Copy the msshrtmi.dll manually to your project. For example in the \bin folder next to the WindowsAzure.Storage.dll.

2.Install the Windows Azure SDK on your server.

3.Change some configurations from app.config.

 <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>

  <runtime>
    <NetFx40_LegacySecurityPolicy enabled="false" />
  </runtime>

For more details, you could refer to this article and this one.

Upvotes: 1

Related Questions