- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
当我运行我的 MVC4 Web 应用程序时,出现以下错误:
Could not load file or assembly 'WebGrease' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'WebGrease' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
我将 web.config 作为:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
在引用了 SO 上的一些答案后,我将其更改为:
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
但还是不行。
可能是什么问题?
编辑:
编辑 2:
安装包后再次出现以下错误:
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'MySql.Web, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 249: <providers>
Line 250: <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />
Line 251: <add name="MySQLMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Clear" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />
Line 252: </providers>
Line 253: </membership>
最佳答案
我遇到了同样的问题。
这被解决了
1) 运行包管理器控制台
2) 在控制台中,键入:'Install-Package Microsoft.AspNet.Web.Optimization'
它解决了所有不正确的依赖关系。
关于c# - 无法加载文件或程序集 'WebGrease' 或其依赖项之一,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21180158/
我的任务是开始使用 ASP.NET Bundling 而不是 RequestReduce。起初这似乎是一件容易的事,但后来我遇到了问题,当 minifieng CSS 文件时: (3017,287):
构建部署包时从 aspnet_compiler.exe 收到以下警告: ASPNETCOMPILER(0,0): Warning : The following assembly has depend
当我运行我的 MVC4 Web 应用程序时,出现以下错误: Could not load file or assembly 'WebGrease' or one of its dependencies
这个问题有很多解决方案,请阅读下面的所有答案,它们也可能会帮助您解决问题。如果您找到解决此问题的新方法,请在您的答案中记录 我正在尝试将 System.Web.Optimization 添加到我的 A
我正在尝试通过命令行使用WebGrease 1.6(还尝试了VS2013的开发人员命令提示符)。当我运行“wg options”时,出现以下错误(附有屏幕截图) 未处理的异常:System.IO.Fi
我已经通过 NuGet 安装了 Microsoft ASP.NET Web 优化框架 1.1.3。我相信它安装得很好。这是一个 .NET 4.0 Web 窗体项目。 当我尝试捆绑时出现错误。我在 Ap
首先,回答这个问题,不要解决我的错误: Upgrading WebGrease to version 1.3.0 gets me error 我的生产服务器上有以下绑定(bind)重定向:
将 WebGrease 升级到版本 1.3.0 时出现错误: Could not load file or assembly 'WebGrease, Version=1.0.0.0, Culture=
当我将名为 glyphicons.css 的特定 CSS 文件放入 BundleConfig 时,会发生以下错误 WebGrease.dll 中发生“System.IndexOutOfRangeExc
例如 System.Linq dogs.ToList().ForEach(dog => Console.WriteLine(dog.Name)); WebGrease.Css.Extensions d
我正在尝试将 bundle 添加到我的 Mvc4 网络元素中。我采取的步骤: 将对我的元素的引用添加到 System.Web.Optimization 已添加 @Styles.Render("~/Co
我有一个 MVC4 Web API 项目。运行服务项目时出现错误 Could not load file or assembly 'WebGrease, Version=1.5.1.25624, Cu
我数了一个问题,在我将WebGrease.dll从1.5.2升级到1.6.0,并部署到azure web role后,出现错误“Object reference not set to an insta
我是一名优秀的程序员,十分优秀!