- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我有一个 HTTPModule,用于在数据中心的网站和 Azure 平台上运行的网站之间重定向流量。此 HTTPModule 从 Azure 表存储检索其重定向规则。
重定向在我的本地开发计算机以及在 Azure 上运行时都可以正常工作。但是,当我将该模块部署到我的数据中心服务器(IIS 7、WS 2008 R2 Standard 64bit、.NET 4.0、ASP.NET 4.0)时,我收到以下错误
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: <add assembly="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
Line 125: <add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
Line 126: <add assembly="*" />
Line 127: </assemblies>
Line 128: <buildProviders>
Source File: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config Line: 126
“msshrtmi.dll”实际上存在于我的部署 bin 目录中。
如果我删除此 dll,数据中心站点工作正常,但 HTTPModule 无法从表存储加载其配置数据,而是抛出以下错误
---> System.TypeInitializationException: The type initializer for 'Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment' threw an exception. ---> 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()
此外,我还手动将“Microsoft.WindowsAzure.ServiceRuntime.dll”包含在部署中,以确保它在数据中心服务器上可用。
最佳答案
Azure 项目似乎对该特定文件非常敏感。来自:http://social.msdn.microsoft.com/Forums/en-US/windowsazuretroubleshooting/thread/0fac1f05-eb55-432f-80ac-6f15cde5b14b/
When you do a rebuild for the web role project, may I ask you to check if a msshrtmi.dll file in the bin folder or not? If yes, then please check if it is 64bit or 32bit using Dependency Walker. If it is 32bit, please try either of the following options to prevent outputing this dll file to bin folder.
Target the web role project to x64 and recreate the azure service project. This option was confirmed by
http://social.msdn.microsoft.com/Forums/en/windowsazure/thread/286cecf6-1423-4ef3-93f9-0eb8a67d8192. (edit: now a dead link as at February '12.)Open the web site project file using Notepad and remove the PlatformTarget element from all configuration property groups. This option is quoted from http://tomkrueger.wordpress.com/2010/07/27/azure-deployment-issue-after-upgrading-to-visual-studio-2010-and-net-4-0/.
Write Post-build event command to delete msshrtmi.dll when a build action is successfully performed. To do this, please right click the web role project and select Properties. Select the Build Events tab, in the "Post-build event command line" textbox, input the following command:
cd $(TargetDir)
del msshrtmi.dll
这一切都表明您需要检查是否已为目标环境上的部署构建了正确的配置。确保您已将 x64 定位为部署到数据中心服务器的目标。
关于c# - 无法加载文件或程序集 'msshrtmi' 或其依赖项之一(Azure 表存储访问),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8273321/
我正在尝试将 Windows Azure 站点从云降级为网站。我收到此错误: Could not load file or assembly 'msshrtmi, Version=1.7.0.0, C
我正在尝试从 TFS(预览版)部署到 Azure 网站(预览版)。构建工作正常并且网站已部署,但是当我的代码尝试访问 Azure RoleEnvironment 时,网站抛出以下异常: Could n
我有一个 HTTPModule,用于在数据中心的网站和 Azure 平台上运行的网站之间重定向流量。此 HTTPModule 从 Azure 表存储检索其重定向规则。 重定向在我的本地开发计算机以及在
我遇到以下问题: Could not load file or assembly 'msshrtmi, Version=2.3.0.0, Culture=neutral, PublicKeyToke
我有一个长期的 Azure 项目,是在 VS2012 中针对 Azure SDK 2.4 构建的,并尝试将其迁移到 VS2015 和 Azure 2.7。我能够构建该项目并在本地运行它,但是当我尝试部
我刚刚为我的项目设置了持续部署构建(使用 azure TFS 服务,又名 Visualstudio.com),但它无法正常工作。构建似乎很好,并且部署开始,但我的辅助角色总是不断循环。我的手册在 Vi
我刚刚为我的项目设置了持续部署构建(使用 azure TFS 服务,又名 Visualstudio.com),但它无法正常工作。构建似乎很好,并且部署开始,但我的辅助角色总是不断循环。我的手册在 Vi
我在 StackOverflow 和其他网站上的其他几个线程中读到过有关此问题的信息。其他解决方案都没有解决我的问题,而且大多数都已经过时,引用了旧版本的 Azure SDK。 我有一个部署到 Azu
我是一名优秀的程序员,十分优秀!