问题描述
我的解决方案包含多个项目并且编译良好.我正在使用 nuget,我使用的包之一是 log4net.2.0.0.我最近将包更新为 log4net.2.0.3,并确保在属于该解决方案的每个项目中,都更新了引用.不幸的是,在编译过程中我仍然收到以下警告:
My solution consists of multiple projects and compiles fine. I'm using nuget and one of the packages that I use is log4net.2.0.0. I've recently updated the package to log4net.2.0.3 and made sure that in each project that belongs to the solution, the reference is updated. Unfortunately I'm still getting the following warning during the compilation process:
(ResolveAssemblyReferences 目标)-> C:Program Files(x86)MSBuild12.0inMicrosoft.Common.CurrentVersion.targets(1635,5):警告 MSB3276:发现不同之间的冲突相同依赖程序集的版本.请设置项目文件中的AutoGenerateBindingRedirects"属性为 true.有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkId=294190.
(ResolveAssemblyReferences target) -> C:Program Files (x86)MSBuild12.0inMicrosoft.Common.CurrentVersion.targe ts(1635,5): warning MSB3276: Found conflicts between different versions of the same dependent assembly. Please set the "AutoGenerateBindingRedirects" property to true in the project file. For more information, see http://go.microsoft.com /fwlink/?LinkId=294190.
或使用/verbosity:detailed 编译时此警告的更详细版本
or a more elaborate version of this warning when compiling with /verbosity:detailed
考虑 app.config 重新映射程序集log4net, Culture=neutral,PublicKeyToken=669e0ddf0bb1aa2a" 从版本 "1.2.11.0" [] 到版本1.2.13.0"[Z:xxxpackageslog4net.2.0.3lib
et40-fulllog4net.dll]解决冲突并消除警告.C:程序文件(x86)MSBuild12.0inMicrosoft.Common.CurrentVersion.targets(1635,5):警告 MSB3276:发现不同版本的相同的依赖程序集.请设置AutoGenerateBindingRedirects"在项目文件中将属性设置为 true.有关详细信息,请参阅http://go.microsoft.com/fwlink/?LinkId=294190.[Z:xxxxxxxxxxxx.csproj]
AssemblyFoldersEx 位置:"{Registry:SoftwareMicrosoft.NETFramework,v4.5,AssemblyFoldersEx}"
Consider app.config remapping of assembly "log4net, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a" from Version "1.2.11.0" [] to Version "1.2.13.0" [Z:xxxpackageslog4net.2.0.3lib et40-fulllog4net.dll] to solve conflict and get rid of warning. C:Program Files (x86)MSBuild12.0inMicrosoft.Common.CurrentVersion.targets(1635,5): warning MSB3276: Found conflicts between different versions of the same dependent assembly. Please set the "AutoGenerateBindingRedirects" property to true in the project file. For more information, see http://go.microsoft.com/fwlink/?LinkId=294190. [Z:xxxxxxxxxxxx.csproj]
AssemblyFoldersEx location: "{Registry:SoftwareMicrosoft.NETFramework,v4.5,AssemblyFoldersEx}"
我明白这意味着什么,遗憾的是我无法确定哪个项目/库仍然引用旧版本的 log4net.我知道我可以通过简单地在 app.config 中重新映射来掩盖警告,但这似乎是在掩盖问题而不是真正正确地解决它.
I understand what it means, unfortunately I can't track down which project/library still references the old version of log4net. I understand that I can mask the warning just by simply remapping in app.config, but it seems like sweeping the problem under the rug rather than actually solving it properly.
在我的解决方案中我引用了旧版本的 log4net 的最佳方法是什么?我已经尝试了所有显而易见的方法,包括在所有文件中搜索版本号.我还确保没有其他 nupkg 将依赖项设置为这个特定版本的 log4net.
What is the best way of tracking down where in my solution I have areference to the old version of log4net? I've tried all the obvious including searching through all the files for the version number. I also made sure that no other nupkgs have the dependencies set to this specific version of log4net.
任何帮助将不胜感激.
推荐答案
感谢我爸和https://github.com/mikehadlow/AsmSpy 我设法找到了:
Thanks to my dad and https://github.com/mikehadlow/AsmSpy I managed to find that:
参考:log4net1.2.11.0 by SuperSocket.SocketBase
Reference: log4net 1.2.11.0 by SuperSocket.SocketBase
哈哈!好用的工具!
这篇关于警告 MSB3276 - 发现同一依赖程序集的不同版本之间存在冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!