title: Could not load file or assembly 'msshrtmi' or one of its dependencies (Azure Table Storage Access)
body: <p>I have an HTTPModule that I use to redirect traffic between a website in my data center and a website running on the Azure platform.  This HTTPModule retrieves its redirect rules from Azure Table Storage.</p>
  
  <p>Redirects work fine on my local dev machine as well as when running on Azure. However, when I deploy the module to my data center servers ( IIS 7, WS 2008 R2 Standard 64bit, .NET 4.0, ASP.NET 4.0 ) I receive the following error</p>
  
  <pre><code>Parser Error Message: Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.
  Line 124:                &lt;add assembly="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/&gt;
  Line 125:                &lt;add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;
  Line 126:                &lt;add assembly="*" /&gt;
  Line 127:            &lt;/assemblies&gt;
  Line 128:            &lt;buildProviders&gt;
  
  Source File: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config    Line: 126 
  </code></pre>
  
  <p>"msshrtmi.dll" actually exists in my deployment bin directory.</p>
  
  <p>If I remove this dll the data center site works fine but but the HTTPModule fails to load its configuration data from Table Storage and instead throws the following error</p>
  
  <pre><code>---&gt; System.TypeInitializationException: The type initializer for 'Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment' threw an exception. ---&gt; System.IO.FileNotFoundException: Could not load file or assembly 'msshrtmi, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
     at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeEnvironment()
     at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment..cctor()
     --- End of inner exception stack trace ---
     at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.get_IsAvailable()
  </code></pre>
  
  <p>Also, I have manually included "Microsoft.WindowsAzure.ServiceRuntime.dll" as part of the deployment to ensure it is available on the data center servers.</p>