简体   繁体   English

是什么导致 WebMatrix.Data.dll 和 WebMatrix.WebData.dll 添加到我的 bin 目录中

[英]What causing WebMatrix.Data.dll and WebMatrix.WebData.dll to be added to my bin directory

I have an MVC ASP.Net app that I have been working on.我有一个我一直在开发的 MVC ASP.Net 应用程序。 It works fine only about half the time when I try to load a page I get diverted to a login.aspx?ReturnUrl=ENCODED_REQUESTED_PATH_HERE .当我尝试加载被转移到login.aspx?ReturnUrl=ENCODED_REQUESTED_PATH_HERE的页面时,它只有大约一半的时间工作正常。 This is very frustrating after some searching on the internet I found that this was caused by在互联网上进行了一些搜索后,这非常令人沮丧,我发现这是由

WebMatrix.Data.dll
WebMatrix.WebData.dll

When I delete these the problem does go away and after commenting out these two lines in my IISExpress applicationhost.config当我删除这些时,问题确实消失了,在我的 IISExpress applicationhost.config 中注释掉这两行之后

<!--<add name="WebMatrixSupportModule" image="%IIS_BIN%\webmatrixsup.dll" />-->
<!--<add name="WebMatrixSupportModule" lockItem="true" />-->

The files stayed away for a while but now they are back and causing the problem again.这些文件离开了一段时间,但现在它们又回来了,并再次引起了问题。

What is putting them in there, there is no reference to them in the project.是什么把它们放在那里,项目中没有提到它们。

They are added by NuGet packages that come with ASP.NET MVC 4 project templates.它们是由 ASP.NET MVC 4 项目模板附带的 NuGet 包添加的。

You can get more information at What is the Microsoft ASP.NET Web Pages 2 Data Nuget Package for?您可以在 Microsoft ASP.NET Web Pages 2 Data Nuget 包的用途是什么?

These assemblies provide Simple Membership Provider that is conflicting with your authentication.这些程序集提供与您的身份验证冲突的简单成员身份提供程序。 Are you using forms auth & have you correctly Implemented Authorize attribute?您是否使用表单身份验证并正确实施了授权属性? If your controllers are marked with Authorize attributes correctly then you will not have any problem.如果您的控制器正确标记了授权属性,那么您将不会有任何问题。 Presence of these dll is not the problem.这些 dll 的存在不是问题。 Your controllers are not property authorized.您的控制器未获得财产授权。

For anyone who suddenly started getting WebMatrix dlls (WebMatrix.Data.dll / WebMatrix.WebData.dll) in their bin: My solution to remove them was the following:对于突然开始在他们的 bin 中获取 WebMatrix dll (WebMatrix.Data.dll / WebMatrix.WebData.dll) 的任何人:我删除它们的解决方案如下:

  1. Install the nuget packages:安装 nuget 包:
    • Microsoft.AspNet.WebPages.Data Microsoft.AspNet.WebPages.Data
    • Microsoft.AspNet.WebPages.WebData Microsoft.AspNet.WebPages.WebData
  2. Then uninstall them.然后卸载它们。

This resulted in the following [dependentAssembly] being added to the Web.config [configuration] -> [runtime] -> [assemblyBinding]这导致以下 [dependentAssembly] 被添加到 Web.config [configuration] -> [runtime] -> [assemblyBinding]

  <dependentAssembly>
    <assemblyIdentity name="WebMatrix.WebData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
  </dependentAssembly>

For some reason, despite the tag "dependent assembly", it does the opposite and prevents the WebMatrix dlls from showing up.出于某种原因,尽管标记为“依赖程序集”,但它会做相反的事情并阻止 WebMatrix dll 出现。

The reason why I personally needed to get rid of the WebMatrix dlls was because, when deployed to a server, it would ask for Razor ver.2, when I had Razor ver.3 included and in active use, throwing an exception and breaking the entire website.我个人需要摆脱 WebMatrix dll 的原因是,当部署到服务器时,它会要求 Razor ver.2,当我包含 Razor ver.3 并在积极使用时,抛出异常并破坏整个网站。 Just, simply, deleting the WebMatrix dlls from the server's bin folder would relieve the website of this problem.只是,简单地,从服务器的 bin 文件夹中删除 WebMatrix dll 可以缓解网站的这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 WebMatrix WebData InitializeDatabaseConnection - WebMatrix WebData InitializeDatabaseConnection Webmatrix.WebData登录方法导致异常 - Webmatrix.WebData Login method results in exception 在WPF应用程序中使用WebMatrix.WebData.WebSecurity - Using WebMatrix.WebData.WebSecurity in a WPF application 使用Microsoft Fake Framework MVC4单元测试WebMatrix.WebData - Unit testing WebMatrix.WebData with Microsoft Fake Framework MVC4 数据访问项目dll未添加到客户端bin文件夹中 - Data Access project dll is not being added to the client bin folder PageData无法在WebMatrix中传递数据 - PageData fails to pass data in WebMatrix 如何将System.Web.UI.DataVisualization.Charting dll放入WebMatrix 3? - How do I get System.Web.UI.DataVisualization.Charting dll into WebMatrix 3? WebMatrix.WebData无法从单独的ASP.NET应用程序中读取成员资格信息 - WebMatrix.WebData can't read membership information from a separate ASP.NET application 无法获取MVC5中引用的用于简单成员资格的Webmatrix.WebData? - Can't get Webmatrix.WebData for Simple Membership referenced in MVC5? WebMatrix.WebData.WebSecurity - 如何只通过PasswordResetToken获取UserName - WebMatrix.WebData.WebSecurity - How can I get UserName by only having PasswordResetToken
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM