如何解决Azure Web部署上的System.Web.Helpers不匹配?

编程入门 行业动态 更新时间:2024-10-27 00:35:16
本文介绍了如何解决Azure Web部署上的System.Web.Helpers不匹配?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我不知道为什么我似乎无法弄清楚这一点.我有点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不匹配?

本文发布于:2023-11-12 07:48:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580919.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何解决   不匹配   Azure   Web   System

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!