title: Azure SDK 2.2 in Production: Could not load file or assembly 'msshrtmi' or one of its dependencies. The system cannot find the file specified
body: <p>I have read about this problem on several other threads both on StackOverflow and other sites. None of the other solutions have solved my problem and most are outdated, referencing old versions of the Azure SDK.</p>
  
  <p>I have a typical Azure website role deployed to Azure that uses <code>Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener</code> to log trace messages. When tracing occurs, it appears as though <code>DiagnosticMonitorTraceListener</code> is using the <code>RoleEnvironment</code> class, which in turn tries to load the apparently non-existent <code>msshrtmi.dll</code>. Here is a portion of the stack trace that is being logged to the file system in Azure:</p>
  
  <pre><code>[FileNotFoundException: Could not load file or assembly &amp;#39;msshrtmi, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&amp;#39; or one of its dependencies. The system cannot find the file specified.]
     Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeEnvironment() +0
     Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment..cctor() +747
  
  [TypeInitializationException: The type initializer for &amp;#39;Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment&amp;#39; threw an exception.]
     Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.get_IsAvailable() +0
     Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.GetDefaultStartupInfoForCurrentRoleInstance() +23
     Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener..ctor() +34
  
  [ConfigurationErrorsException: Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.]
     System.Diagnostics.TraceUtils.GetRuntimeObject(String className, Type baseType, String initializeData) +9004943
     System.Diagnostics.TypedElement.BaseGetRuntimeObject() +110
     System.Diagnostics.ListenerElement.GetRuntimeObject() +989
     System.Diagnostics.ListenerElementsCollection.GetRuntimeObject() +252
     System.Diagnostics.TraceInternal.get_Listeners() +331
     System.Diagnostics.TraceInternal.WriteLine(String message) +161
     Microsoft.WindowsAzure.AzureApplicationSettings..ctor() +437
     Microsoft.WindowsAzure.CloudConfigurationManager.get_AppSettings() +137
     Microsoft.WindowsAzure.CloudConfigurationManager.GetSetting(String name) +27
     TankSoft.EverMarket.EverMarketPrereleaseRole.Endpoints.Api.Notify..ctor() +40
     lambda_method(Closure , Object[] ) +60
     Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +315
  </code></pre>
  
  <p>Various threads have mentioned how I need to clean this DLL from my bin folder, but the DLL is not being copied in the first place. I suspect this has to do with me running under Azure SDK 2.2 and not 1.x. I realize I can reference the DLL directly but I feel that I should not have to do this in order to deploy what is a quite normal project to Azure. Why is Microsoft not automatically detecting that my project requires this file and deploying the correct file for me? This is maddening.</p>
  
  <p>Let me also say that the project I am publishing is <em>not a Cloud Service</em> but rather a regular Azure website project.</p>
  
  <p>Has anyone <em>running Azure SDK 2.x</em> managed to solve this issue? What were the exact steps you followed?</p>