首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >VS2012 NuGet更新导致生成时的神秘警告

VS2012 NuGet更新导致生成时的神秘警告
EN

Stack Overflow用户
提问于 2013-09-03 21:01:29
回答 2查看 1.6K关注 0票数 1

最近的Visual 2012更新似乎破坏了我的构建中的某些内容。我认为这与上周的nuget更新有关。

代码语言:javascript
复制
NuGet package restore started.
All packages are already installed and there is nothing to restore.
NuGet package restore finished.
1>------ Rebuild All started: Project: Project1, Configuration: Debug Any CPU ------
1>  Consider app.config remapping of assembly "Microsoft.Data.OData, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "5.2.0.0" [] to Version "5.6.0.0" [C:\Users\avianbc\Desktop\Project1\packages\Microsoft.Data.OData.5.6.0\lib\net40\Microsoft.Data.OData.dll] to solve conflict and get rid of warning.
1>  Consider app.config remapping of assembly "Microsoft.Data.Edm, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "5.2.0.0" [] to Version "5.6.0.0" [C:\Users\avianbc\Desktop\Project1\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll] to solve conflict and get rid of warning.
1>  Consider app.config remapping of assembly "System.Spatial, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "5.2.0.0" [] to Version "5.6.0.0" [C:\Users\avianbc\Desktop\Project1\packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll] to solve conflict and get rid of warning.
1>c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly.
1>  Project1 -> C:\Users\avianbc\Desktop\Project1\Project1\bin\Project1.dll
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

我如何解决这些警告?我的应用程序出现了一些奇怪的副作用,比如:不一致的模型绑定(与Edm程序集相关?)。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-09-04 01:40:03

我不知道你为什么认为这很神秘,这很清楚。您已经安装了多个版本的这些包(5.2和5.6) --一些组件引用了5.2和5.6,这导致了警告。这意味着您的别名为5.2到5.6,因此引用5.2的程序集将使用5.6。

不过,这可能不是最好的方法,除非您无法控制这些程序集。您可能应该卸载5.2包,然后将nuget引用更新到5.6版本并重新构建。

票数 2
EN

Stack Overflow用户

发布于 2013-09-05 18:04:02

如消息所示,您可以通过将程序集版本5.2映射到版本5.6来修复这些警告。您可以通过编辑配置文件的assemblyBinding来做到这一点。在本例中,添加以下XML:

代码语言:javascript
复制
<dependentAssembly>
    <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.6.0.0" />
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.6.0.0" />
</dependentAssembly>
<dependentAssembly>
    <assemblyIdentity name="System.Spatial" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.6.0.0" />
</dependentAssembly>
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18601423

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档