我不知道为什么我似乎无法弄清楚这一点.我有点DLL强命名地狱.这是正在发生的事情:
I don't know why I can't seem to figure this out. I'm in a bit of DLL strong-naming hell. Here's what's happening:
- 我正在使用Visual Studio 2012 RC创建针对.NET 4.0的MVC4网站
- 我正在尝试使用Microsoft.Web.Helpers库中的Gravatar Razor帮助程序
-
它在我的机器上可以运行,但是在通过Git部署到Azure之后,在调用Gravatar帮助程序时出现以下异常:
- I'm using Visual Studio 2012 RC to make an MVC4 site targeting .NET 4.0
- I'm attempting to use the Gravatar Razor helper in the Microsoft.Web.Helpers library
It works on my machine, but after deploying to Azure via Git, I get the following exception on invoking the Gravatar helper:
无法加载文件或程序集'System.Web.Helpers,版本= 2.0.0.0,区域性=中性,PublicKeyToken = 31bf3856ad364e35'或其依赖项之一.系统找不到指定的文件.
Could not load file or assembly 'System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
似乎在GAC上安装的System.Web.Helpers版本与托管我的Azure网站的内容和我定位的目标之间都不匹配.
It seems that I've got a mismatch between the version of System.Web.Helpers installed on the GAC of whatever's hosting my Azure site and what I'm targeting.
这是我尝试过的:
- 复制本地= true
- 缺少我自己的_bin_deployableAssemblies文件夹,因为菲尔·哈克(Phil Haack)的博客
- 删除.csproj文件中System.Web.Helpers的扩展程序集信息
此外,我在web.config中具有以下程序集绑定重定向:
Also, I have the following assembly binding redirect in the web.config:
<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" /> </dependentAssembly> ... </runtime>有人吗?
推荐答案您说您尝试过copylocal = true,但是您确保将程序集部署到服务器上吗?
You said you tried copylocal=true, but have you ensured that the assembly is getting deployed to the server?
潜在问题:
•.gitignore具有.dll过滤器
• .gitignore has a .dll filter
我将FTP到服务器并检查以确保程序集实际上在bin目录中
I would FTP to the server and check to ensure the assembly is actually in the bin directory
更多推荐
如何解决Azure Web部署上的System.Web.Helpers不匹配?
发布评论