Friday, August 26, 2011

msshrtmi.dll - Hybrid Applications: Running in the cloud AND on premise

Recently I tried to deploy an application that was originally designed for the cloud on an in-house server. The only cloud capability the application used was the Windows Azure Blob Storage.

So in advance I changed the application to differ between

  • being run in the cloud and using the Blob Storage and
  • being run on premise and using the local disk storage

by using the following flag as an indicator:

  1: RoleEnvironment.IsAvailable

In both scenarios the deployment contains the Microsoft.WindowsAzure.StorageClient.dll. This works perfectly in the cloud but raised the following error on premise:


Exception type: FileNotFoundException
Exception message: File or assembly "msshrtmi, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", or one of its dependencies, was not found.
   at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeEnvironment()
   at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment..cctor()


There are two possible ways to solve this issue:



  1. Copy the msshrtmi.dll manually to your on premise deployment.
    For example in the \bin folder next to the WindowsAzure.StorageClient.dll.

  2. Install the Windows Azure SDK on your in-house server.