[英]OAuth.dll using higher version than referenced assembly of webMatrix.data and webmatrix.webdata
I am getting this error:我收到此错误:
Assembly 'Microsoft.Web.WebPages.OAuth, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' uses 'WebMatrix.WebData, Version=3.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version
than referenced assembly 'WebMatrix.WebData, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35'
I have followed this post Could not load file or assembly 'WebMatrix.Data` from the stack overflow and installed it我已经关注了这篇文章无法从堆栈溢出加载文件或程序集“WebMatrix.Data ”并安装它
PM> Install-Package WebMatrix.Data but not working. PM> Install-Package WebMatrix.Data 但不工作。
then i deleted packages folder and restore it that also not working.然后我删除了包文件夹并恢复它也不起作用。
I tried the following:我尝试了以下方法:
PM> Uninstall-package Microsoft.AspNet.WebPages.OAuth then installed it again.that's also not working. PM> 卸载包 Microsoft.AspNet.WebPages.OAuth 然后再次安装它。这也不起作用。
First thing notice able, if I tried to install the nuget packages seperately----首先要注意的是,如果我尝试单独安装 nuget 软件包----
PM> Install-Package WebMatrix.WebData
and和
PM> Install-Package WebMatrix.Data
Then its providing me only this vrsion 2.0.30506然后它只为我提供这个版本 2.0.30506
I don't know how to resolve this issue.我不知道如何解决这个问题。 The web.config file is something like this.
web.config 文件是这样的。
<dependentAssembly>
<assemblyIdentity name="WebMatrix.Data" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
take a look at Nuget listing for WebMatrix.WebData and WebMatrix.Data看看WebMatrix.WebData和WebMatrix.Data 的Nuget 列表
https://www.nuget.org/packages/WebMatrix.Data/ https://www.nuget.org/packages/WebMatrix.Data/
https://www.nuget.org/packages/WebMatrix.WebData/ https://www.nuget.org/packages/WebMatrix.WebData/
notice that they were注意他们是
last updated on Friday, May 31, 2013
最后更新于2013 年 5 月 31 日,星期五
These assemblies were moved into这些程序集被移入
Microsoft ASP.NET Web Pages Data 3.2.3 https://www.nuget.org/packages/Microsoft.AspNet.WebPages.Data/ Microsoft ASP.NET 网页数据 3.2.3 https://www.nuget.org/packages/Microsoft.AspNet.WebPages.Data/
Microsoft ASP.NET Web Pages Web Data 3.2.3 https://www.nuget.org/packages/Microsoft.AspNet.WebPages.WebData/ Microsoft ASP.NET 网页 Web 数据 3.2.3 https://www.nuget.org/packages/Microsoft.AspNet.WebPages.WebData/
Because the names of the assembly names have remained the same, but the locations have changes, Nuget Package Manager gets confused -- failing to correctly add / remove the references from your project.由于程序集名称的名称保持不变,但位置发生了变化,Nuget 包管理器会感到困惑——无法从项目中正确添加/删除引用。
WebPages.Data
and/or WebPages.WebData
WebPages.Data
和/或WebPages.WebData
任何引用Install-Package Microsoft.AspNet.WebPages.WebData
Install-Package Microsoft.AspNet.WebPages.Data
packages\\Microsoft.AspNet.WebPages.Data.3.2.3\\lib\\net45
double click WebMatrix.WebData.dll
packages\\Microsoft.AspNet.WebPages.Data.3.2.3\\lib\\net45
双击WebMatrix.WebData.dll
packages\\Microsoft.AspNet.WebPages.Data.3.2.3\\lib\\net45
double click WebMatrix.Data.dll
packages\\Microsoft.AspNet.WebPages.Data.3.2.3\\lib\\net45
双击WebMatrix.Data.dll
finally:最后:
in your Web.config , remove or comment out any references to dependentAssembly named WebMatrix.Data
and/or WebMatrix.WebData
在您的Web.config 中,删除或注释掉任何对名为
WebMatrix.Data
和/或WebMatrix.WebData
dependentAssembly 的引用
Re-build and run重新构建并运行
So the problem was: the package Microsoft.AspNet.WebPages.WebData was not installed properly, so I uninstalled and re-installed it (along with all the dependent packages).所以问题是:包 Microsoft.AspNet.WebPages.WebData 没有正确安装,所以我卸载并重新安装了它(以及所有依赖包)。
To do this, I ran:为此,我跑了:
Uninstall-Package Microsoft.AspNet.WebPages.OAuth
Uninstall-Package DotNetOpenAuth.AspNet
Uninstall-Package DotNetOpenAuth.OAuth.Consumer
Uninstall-Package DotNetOpenAuth.OAuth.Core
Uninstall-Package DotNetOpenAuth.OpenId.RelyingParty
Uninstall-Package DotNetOpenAuth.OpenId.Core
Uninstall-Package DotNetOpenAuth.core
Uninstall-Package Microsoft.AspNet.WebPages.WebData
Install-Package Microsoft.AspNet.WebPages.WebData
Install-Package DotNetOpenAuth.core
Install-Package DotNetOpenAuth.OAuth.Core
Install-Package DotNetOpenAuth.OpenId.RelyingParty
Install-Package DotNetOpenAuth.OpenId.Core
Install-Package DotNetOpenAuth.OAuth.Consumer
Install-Package DotNetOpenAuth.AspNet
Install-Package Microsoft.AspNet.WebPages.OAuth
I then used the instructions from Dave Alperovich above to add the correct version of the references.然后我使用上面 Dave Alperovich 的说明添加了正确版本的参考资料。 Now the error is gone.
现在错误消失了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.