简体   繁体   English

无法加载文件或程序集'WebMatrix.Data,Version = 3.0.0.0

[英]Could not load file or assembly 'WebMatrix.Data, Version=3.0.0.0

Could not load file or assembly 'WebMatrix.Data, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 无法加载文件或程序集'WebMatrix.Data,Version = 3.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'或其依赖项之一。 The system cannot find the file specified. 该系统找不到指定的文件。

Is this a solution that you have created or one you have downloaded (as a sample or as work done by a colleague)? 这是您创建的解决方案还是已下载的解决方案(作为示例或由同事完成的工作)? Do you have an up to data version of NuGet installed within Visual Studio and have you checked installed packages for the project - you may need to restore packages if you have downloaded the solution from Source Control or as a zip sample online. 您是否在Visual Studio中安装了最新的NuGet数据版本,并且已检查项目的已安装软件包 - 如果您已从Source Control下载解决方案或在线下载zip样本,则可能需要还原软件包。

The easiest way to do this is to check that NuGet Package Manager is up to date in "Tools" > "Extensions and Updates" and then (with the applicable project selected in Visual Studio) select "Project" > "Manage NuGet Packages". 最简单的方法是在“工具”>“扩展和更新”中检查NuGet包管理器是否是最新的,然后(在Visual Studio中选择适用的项目)选择“项目”>“管理NuGet包”。 If there are installed Packages which are not found in your solution packages directory then NuGet should offer to restore them for you. 如果在解决方案包目录中找不到已安装的软件包,那么NuGet应该提供为您恢复它们。

Alternatively you may have added a package which has a dependency on that package, and you either do not have it installed or have a previous version. 或者,您可能添加了一个依赖于该程序包的程序包,并且您没有安装它或具有以前的版本。

To install the package within NuGet Package Manager Console type- 要在NuGet Package Manager控制台类型中安装软件包 -

Install-Package Microsoft.AspNet.WebPages.Data 安装包Microsoft.AspNet.WebPages.Data

Or search for "Microsoft.AspNet.WebPages.Data" in the "Manage NuGet Packages" window, accessed via the instructions above. 或者在“管理NuGet包”窗口中搜索“Microsoft.AspNet.WebPages.Data”,可通过上述说明访问。

If you have a prior version of the package installed, you may need to remap that version number to the version 3.0.0.0 with the following code in your project config (most likely Web.config) file in order to avoid breaking packages with dependencies on the previous version- 如果您安装了该软件包的早期版本,则可能需要将该版本号重新映射到版本3.0.0.0,并在项目配置(很可能是Web.config)文件中使用以下代码,以避免破坏具有依赖性的软件包。以前的版本 -

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

I had a similar problem, and I fixed it by doing the following: 我有类似的问题,我通过执行以下操作修复了它:

  1. Installing the package via package manager console(from visual studio) Use the following commands: 通过包管理器控制台安装包(来自visual studio)使用以下命令:

    PM> Install-package WebMatrix.Data PM>安装包WebMatrix.Data

    PM> Install-package WebMatrix.WebData PM>安装包WebMatrix.WebData

  2. Add a binding Redirect in Web.config file Between <runtime></runtime> tags: 在Web.config文件中添加绑定重定向在<runtime> </ runtime>标记之间:

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

3.I've copied both dlls from: /YourProject/packages folder to /YourProject/bin folder 3.我已将以下两个dll复制到/ YourProject / packages文件夹到/ YourProject / bin文件夹

(Optional) If you can't find the dlls in /YourProject/packages folder, try search for the dlls in /YourProject/bin/Debug folder, and copy/Paste them into /YourProject/bin folder instead. (可选)如果在/ YourProject / packages文件夹中找不到dll,请尝试在/ YourProject / bin / Debug文件夹中搜索dll,然后将它们复制/粘贴到/ YourProject / bin文件夹中。

It solved the problem for me. 它解决了我的问题。

The only thing that worked for me was editing the properties of the DLL (right-click the WebMatrix.WebData DLL in solution explorer and select Properties), changing the "Copy Local" property to true. 唯一对我有用的是编辑DLL的属性(右键单击解决方案资源管理器中的WebMatrix.WebData DLL并选择Properties),将“Copy Local”属性更改为true。 Same for the WebMatrix.Data DLL. WebMatrix.Data DLL也是如此。

Following solution helped us 以下解决方案帮助了我

step 1: Delete the service reference and build the app (will show error) step 2: Add service reference again -> click on advance button step 3: uncheck "Reuse types in referenced assemblies" and then click on OK step 4: Rebuild the application 步骤1:删除服务引用并构建应用程序(将显示错误)步骤2:再次添加服务引用 - >单击提前按钮步骤3:取消选中“在引用的程序集中重用类型”,然后单击“确定”。步骤4:重建应用

暂无
暂无

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

相关问题 无法加载文件或程序集'WebMatrix.Data` - Could not load file or assembly 'WebMatrix.Data` 使用比 webMatrix.data 和 webmatrix.webdata 引用程序集更高版本的 OAuth.dll - OAuth.dll using higher version than referenced assembly of webMatrix.data and webmatrix.webdata 无法加载文件或程序集“System.Web.Mvc,版本=3.0.0.0,Elmah.MVC 问题” - Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Elmah.MVC issue 无法加载文件或程序集System.Web.WebPages.Razor ,, Version = 3.0.0.0或其依赖项之一 - Could not load file or assembly System.Web.WebPages.Razor, , Version=3.0.0.0 or one of its dependencies 无法加载文件或程序集“System.Web.Mvc,Version = 3.0.0.0”或其依赖项之一 - Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0' or one of its dependencies 无法在“新”框中加载文件或程序集&#39;System.Web.Mvc,版本= 3.0.0.0 - Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0 on NEW box 无法在服务器上加载文件或程序集&#39;System.Web.Mvc,Version = 3.0.0.0 - Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0 at server 无法加载文件或程序集&#39;System.Web.WebPages.Razor,Version = 3.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35&#39; - Could not load file or assembly 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 如何获取列名WebMatrix.Data - How to get column names WebMatrix.Data 无法加载文件或程序集“System.Web.WebPages.Razor,版本=3.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”ASP.NET MVC - Could not load file or assembly 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' ASP.NET MVC
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM