在编译一个从VS2003的VS2003 1.1移植到VS2008的.NET 3.5的解决方案时,我得到了一些建议,其中有代表性的是这个:
考虑从版本"1.0.5000.0“到版本"2.0.0.0”C:\Program (x86)\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE\System.Windows.Forms.dll,将程序集"System.Windows.Forms,Culture=neutral,PublicKeyToken=969db8053d3322ac,Retargetable=Yes“的app.config重新映射,以解决冲突并消除警告。
解决方案中的两个项目都没有app.config文件。然而,有大量包含“*.resx”的Version=1.0.5000.0文件。
我是否应该在全球范围内搜索并用"Version=2.0.0.0“替换这些内容,或者我应该如何纠正这个问题?
更新
我选择了重新构建的“项目>升级项目”,现在消息包括:
C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets :警告MSB3245:无法解析此引用。无法找到程序集"System.Windows.Forms.DataGrid“。检查以确保程序集存在于磁盘上。如果代码需要此引用,则可能会出现编译错误。
无法解决"System.Xml,Version=2.0.0.0,Culture=neutral,PublicKeyToken=969db8053d3322ac,Retargetable=Yes“和"System.Xml,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089”之间的冲突。任意选择"System.Xml,Version=2.0.0.0,Culture=neutral,PublicKeyToken=969db8053d3322ac,Retargetable=Yes“。
无法解决“系统、Version=2.0.0.0、Culture=neutral、PublicKeyToken=969db8053d3322ac、Retargetable=Yes”和“系统、Version=2.0.0.0、Culture=neutral、PublicKeyToken=b77a5c561934e089”之间的冲突。任意选择“系统、Version=2.0.0.0、Culture=neutral、PublicKeyToken=969db8053d3322ac、Retargetable=Yes”。
考虑从版本"1.0.5000.0“到版本"3.5.0.0”C:\Program (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Windows.Forms.dll,将程序集"System.Windows.Forms,Culture=neutral,PublicKeyToken=969db8053d3322ac,Retargetable=Yes“的app.config重新映射,以解决冲突并消除警告。
更新2
我的代码中确实有这一行:
this.dtGridUPC = new System.Windows.Forms.DataGrid();
尽管编译器警告我:“无法找到程序集"System.Windows.Forms.DataGrid”。请检查程序集是否存在于磁盘上。如果代码需要此引用,您可能会得到编译错误。“
...I没有编译错误。
越来越好奇。
发布于 2021-04-08 13:25:11
在我的示例中,输出窗口中显示了以下警告:
11> Consider app.config remapping of assembly "log4net, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a" from Version "1.2.15.0" [] to Version "2.0.12.0" [C:\s\[SolutionName]\log4net.dll] to solve conflict and get rid of warning.
11>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="log4net" culture="neutral" publicKeyToken="669e0ddf0bb1aa2a" /><bindingRedirect oldVersion="0.0.0.0-2.0.12.0" newVersion="2.0.12.0" /></dependentAssembly></assemblyBinding>
当我在“输出”窗口中单击此警告时,"C:\Program (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets“文件打开。我很惊讶我应该改变我的解决方案文件夹之外的东西。另一个令人惊讶的是,我应该更改app.config,即使我使用web.config配置文件处理web服务。程序员可能没有意识到这个警告也显示了服务..。
无论如何,双击错误列表窗口中的此警告,而不是在输出窗口中。请确保按下错误列表窗口顶部的“警告”按钮,以便在“错误列表”窗口中看到此警告。这样你就应该用适当的方法来解决这个警告。
https://stackoverflow.com/questions/19164239
复制相似问题