0

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

AlfaTeK
  • 7,487
  • 14
  • 49
  • 90

1 Answers1

1

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.

Joey Cai
  • 18,968
  • 1
  • 20
  • 30
  • what do you mean by "2.Install the Windows Azure SDK on your server." ? I'm running all of this on localhost and already have azure sdk installed. – AlfaTeK Jan 24 '19 at 10:40
  • option 3 doesn't work. option 1 obviously work but I don't want to do it like this because otherwise I'll mess things up for the other members of the project – AlfaTeK Feb 07 '19 at 12:34