无法加载文件或程序集“WebMatrix.Data` [英] Could not load file or assembly 'WebMatrix.Data`

查看:817
本文介绍了无法加载文件或程序集“WebMatrix.Data`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我更新MVC4到MVC5。当你运行该应用程序我得到了我没有 WebMatrix.Data 错误。我安装了它 PM>安装封装WebMatrix.Data 。现在,当你开始在浏览器中:


  

无法加载文件或程序集WebMatrix.Data,版本= 3.0.0.0,
  文化=中性公钥= 31bf3856ad364e35'或一个其
  依赖。位于集清单定义不匹配
  大会参考。 (异常来自HRESULT:0x80131040)


任何人都知道如何解决这个问题?

包管理器控制台登录

 试图解决依赖'Microsoft.AspNet.WebPages.Data(≥2.0.20710.0)。
安装WebMatrix.Data 2.0.30506.0。
您是来自微软,到可在http://www.microsoft.com/web/webpi/eula/aspnetcomponent_rtw_enu.htm许可协议下载WebMatrix.Data。检查包装额外的依赖关系,这可能会带着自己的许可协议(S)。您使用的程序包和依赖关系构成您的许可协议的接受。如果您不接受许可协议(S),然后从设备中删除相关组件。
成功安装WebMatrix.Data 2.0.30506.0。
添加WebMatrix.Data 2.0.30506.0到XXX。
已成功添加WebMatrix.Data 2.0.30506.0来xxx.`

code 的Web.config

海贼王

 <&运行GT;
    < assemblyBinding的xmlns =瓮:架构 - 微软COM:asm.v1>
      < dependentAssembly>
        < assemblyIdentity名称=System.Web.Mvc公钥=31bf3856ad364e35/>
        < bindingRedirect oldVersion =0.0.0.0-5.0.0.0NEWVERSION =5.0.0.0/>
      < / dependentAssembly>
      < dependentAssembly>
        < assemblyIdentity名称=WebGrease公钥=31bf3856ad364e35/>
        < bindingRedirect oldVersion =0.0.0.0-1.3.0.0NEWVERSION =1.3.0.0/>
      < / dependentAssembly>
      < dependentAssembly>
        < assemblyIdentity名称=的EntityFramework公钥=b77a5c561934e089文化=中性/>
        < bindingRedirect oldVersion =0.0.0.0-6.0.0.0NEWVERSION =6.0.0.0/>
      < / dependentAssembly>
      < dependentAssembly>
        < assemblyIdentity名称=DotNetOpenAuth.AspNet公钥=2780ccd10d57b246文化=中性/>
        < bindingRedirect oldVersion =0.0.0.0-4.3.0.0NEWVERSION =4.3.0.0/>
      < / dependentAssembly>
      < dependentAssembly>
        < assemblyIdentity名称=DotNetOpenAuth.Core公钥=2780ccd10d57b246文化=中性/>
        < bindingRedirect oldVersion =0.0.0.0-4.3.0.0NEWVERSION =4.3.0.0/>
      < / dependentAssembly>
      < dependentAssembly>
        < assemblyIdentity名称=Microsoft.AspNet.Identity.Core公钥=31bf3856ad364e35文化=中性/>
        < bindingRedirect oldVersion =0.0.0.0-2.0.0.0NEWVERSION =2.0.0.0/>
      < / dependentAssembly>
      < dependentAssembly>
        < assemblyIdentity名称=System.Web.Helpers公钥=31bf3856ad364e35/>
        < bindingRedirect oldVersion =1.0.0.0-3.0.0.0NEWVERSION =3.0.0.0/>
      < / dependentAssembly>
      < dependentAssembly>
        < assemblyIdentity名称=System.Web.WebPages公钥=31bf3856ad364e35/>
        < bindingRedirect oldVersion =0.0.0.0-3.0.0.0NEWVERSION =3.0.0.0/>
      < / dependentAssembly>
      < dependentAssembly>
        < assemblyIdentity名称=System.Web.Razor公钥=31bf3856ad364e35文化=中性/>
        < bindingRedirect oldVersion =0.0.0.0-3.0.0.0NEWVERSION =3.0.0.0/>
      < / dependentAssembly>
      < dependentAssembly>
        < assemblyIdentity名称=System.Web.WebPages.Razor公钥=31bf3856ad364e35文化=中性/>
        < bindingRedirect oldVersion =0.0.0.0-3.0.0.0NEWVERSION =3.0.0.0/>
      < / dependentAssembly>
      < dependentAssembly>
        < assemblyIdentity名称=WebMatrix.WebData公钥=31bf3856ad364e35文化=中性/>
        < bindingRedirect oldVersion =0.0.0.0-3.0.0.0NEWVERSION =3.0.0.0/>
      < / dependentAssembly>
      < dependentAssembly>
        < assemblyIdentity名称=WebMatrix.Data公钥=31bf3856ad364e35文化=中性/>
        < bindingRedirect oldVersion =0.0.0.0-2.0.0.0NEWVERSION =2.0.0.0/>
      < / dependentAssembly>
    < / assemblyBinding>
  < /运行>


解决方案

走进:工具>的NuGet包经理>包管理器控制台

和运行以下命令:

  PM>安装封装Microsoft.AspNet.WebPages.Data

I updated MVC4 to MVC5. When you run the application I got an error that I don't have WebMatrix.Data. I installed it PM> Install-Package WebMatrix.Data. Now when you start getting in the browser:

Could not load file or assembly 'WebMatrix.Data, Version = 3.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35' or one of its dependencies. Located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Anyone know how to fix this?

Package Manager Console Log

Attempting to resolve dependency 'Microsoft.AspNet.WebPages.Data (≥ 2.0.20710.0)'.
Installing 'WebMatrix.Data 2.0.30506.0'.
You are downloading WebMatrix.Data from Microsoft, the license agreement to which is available at http://www.microsoft.com/web/webpi/eula/aspnetcomponent_rtw_enu.htm. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'WebMatrix.Data 2.0.30506.0'.
Adding 'WebMatrix.Data 2.0.30506.0' to xxx.
Successfully added 'WebMatrix.Data 2.0.30506.0' to xxx.`

Piece of code Web.config

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.AspNet.Identity.Core" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <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>
      <dependentAssembly>
        <assemblyIdentity name="WebMatrix.Data" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

解决方案

Go into: Tools > NuGet Package Manager > Package Manager Console

And run the following command:

PM> Install-Package Microsoft.AspNet.WebPages.Data

这篇关于无法加载文件或程序集“WebMatrix.Data`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆