- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的代码的本地版本运行得很好。但是当我进行网络部署时,出现以下异常:
Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
相关的堆栈跟踪行是
[FileLoadException: Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)] Microsoft.Web.WebPages.OAuth.PreApplicationStartCode.Start() +0
这似乎与 Razor 的 Nuget 包是 3.0 版但 DotNetOpenAuth 包使用 2.0 版有关
此外,该问题仅在我部署到我的 Azure 网站时发生。 (我目前使用的是免费网站,而不是 webrole/workrole 的东西)。我使用 webdeploy,它在以前的版本中工作正常,但我相信这与 nuget 包有关。
更新:我无法解决这个问题。我曾尝试通过 FTP 进行部署,在部署之前删除了整个文件夹,但这也不起作用。 Nuget 一直是一场噩梦。
最佳答案
将它放在您的 web.config 文件中。它将导致框架将依赖项重定向到适当的版本。
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<configuration>
从 future 编辑
当我由于上述语法中指出的 XML 错误而重新访问这篇文章时,还有一些其他地方很可能也需要更新。首先,在主 web.config 中,应在 <appSettings>
中更改此行以下部分
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
另外,views文件夹下有个web.config,应该更新成如下
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
基本上,除了程序集重定向之外,您还想识别所有提到 razor 2.0.0.0 的地方并将它们更改为 3.0.0.0。我相信我有上面确定的所有这些位置。
如果您更新整个 MVC 框架,还需要执行额外的工作,但这不是问题的基础。
关于.net - DotNetOpenAuth 导致无法加载程序集 System.Web.WebPages.Razor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19749416/
我刚刚使用 Log4net 设置了一个日志记录提供程序,并在测试时注意到 DotNetOpenAuth 也在记录消息。他们一定也在使用 log4net,太棒了,我不希望每次有人使用 openID 登录
我正在尝试使用 DNOA 为我的应用程序提供 OpenId 支持,以便离开我迄今为止一直在使用的 Janrain 解决方案。问题是,到目前为止,我拥有的用户拥有基于个人资料的标识符(https://w
我只想使用 google 登录,并希望在我的网站上显示在用户的一般配置文件(如照片、电子邮件地址和姓名)中登录的访问权限。 DotNetOpenAuth 有可能吗? 最佳答案 这非常简单。使用 Ope
我目前正在从 Janrain engange (rpxnow) 切换到 dotnetopenauth。在我的数据库中,我将用户声明的标识符存储在表单中 https://www.google.com/a
我正在使用 Dotnetopenid 进行登录。 我正在使用 dotnetopenid 提供商登录我的应用程序(假设是 google)。 在注销时,我将通过 FormsAuthentication.S
您好, 我想将 ClaimedIdentifier 保存在数据库中。 它可以持续多久? 大概 255 个字符可以吗? 最佳答案 openid.claimed_id 仅受 URL 的最大长度限制,从技术
我刚刚开始将 DotNetOpenAuth 与 MVC 应用程序一起使用,我很难理解它的实际工作原理。 据我了解,DotNetOpenAuth 将负责使用 Google/Twitter/Faceboo
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 想改进这个问题?将问题更新为 on-topic对于堆栈溢出。 8年前关闭。 Improve this qu
我正在通过dotNetOpenAuth Samples (OpenIdRelyingPartyMVC 和 OpenIdProviderMvc)并提出一个问题以更好地理解...... 例如,在依赖方应用
我正在为 OpenId 提供商和依赖方实现 DotNetOpenAuth。在这两种情况下,服务器都位于负载均衡器后面,因此对于任何 HTTP 请求,我们不能假设我们会访问同一服务器。 看来 DotNe
我有一个负载均衡器,后面有一些网络服务器。到达负载均衡器的流量通过 SSL 进行保护,并且从负载均衡器到 Web 服务器的数据作为未加密的 HTTP 流量发送。我在 Web 服务器上的负载均衡器后面使
我已经下载了与http://www.dotnetopenauth.net/关联的Visual Studio 2010模板。我可以像宣传的那样使它工作。我不是从头开始一个项目,也不想花很多时间将所有we
我正在尝试使用 ASP.NET MVC 实现 OpeinID 登录。我正在尝试按照 http://blog.nerdbank.net/2008/04/add-openid-login-support-
如果您从 Github 源构建,您会在检查签名程序集时遇到错误。 是否可以只更改: SignAssembly = false DelaySign = false 在 tools\DotNetOpenA
源代码托管在哪里? git 中心?我到处都找不到它。 最佳答案 是的,它与项目的其余部分一起位于 GitHub 上。它位于 master 分支下。 https://github.com/AArnott
我使用此页面(第一个示例)提供的代码创建了一个简单页面: http://www.dotnetopenauth.net/developers/code-snippets/programmatic-ope
我有以下代码: protected void Page_Load(object sender, EventArgs e) { var openId = new OpenIdRelyingPar
我知道 stackoverflow 使用 OpenID 身份验证。我也想尝试使用它。我正在使用带有 C# 的 asp.net mvc 2.0。 我找到了这个 http://www.dotnetopen
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 5 年前。
几天来,我一直在绞尽脑汁,试图使用 DotNetOpenAuth 从 Google 获取日历列表。 我可以使用 DotNetOpenAuth 示例成功获取联系人列表。我使用 OpenId+OAuth
我是一名优秀的程序员,十分优秀!