当编译器告诉我“考虑app.config重新映射"时,应该更改什么?当我没有app.config文件时? [英] What should I change when the compiler tells me to "Consider app.config remapping" when I have no app.config file?

查看:185
本文介绍了当编译器告诉我“考虑app.config重新映射"时,应该更改什么?当我没有app.config文件时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在编译从VS2003中的.NET 1.1移植到VS2008中的.NET 3.5的解决方案时,我得到了一些建议,其中有代表性的建议是

In compiling a solution ported from .NET 1.1 in VS2003 to .NET 3.5 in VS2008, I get several suggestions, of which this one is representative:

考虑对程序集"System.Windows.Forms,Culture = neutral,PublicKeyToken = 969db8053d3322ac,Retargetable = Yes"的app.config重新映射,从版本"1.0.5000.0" []到版本"2.0.0.0" [C :\ Program Files(x86)\ Microsoft.NET \ SDK \ CompactFramework \ v2.0 \ WindowsCE \ System.Windows.Forms.dll]解决冲突并摆脱警告.

解决方案中的两个项目都没有app.config文件.但是,有成千上万个* .resx文件包含"Version = 1.0.5000.0"

Neither project in the solution has an app.config file. There are, however, gazillions of *.resx files that contain "Version=1.0.5000.0"

我应该进行全局搜索并将其替换为"Version = 2.0.0.0",还是应该纠正该问题?

Should I do a global search and replace of those with "Version=2.0.0.0" or how should I rectify this?

我选择了项目>升级项目",进行了重建,现在消息包括:

I selected "Project > Upgrade Project", rebuilt, and now the messages include:

C:\ Windows \ Microsoft.NET \ Framework \ v3.5 \ Microsoft.Common.targets:警告MSB3245:无法解析此引用.无法找到程序集"System.Windows.Forms.DataGrid".检查以确保程序集在磁盘上.如果您的代码需要此引用,则可能会出现编译错误.

无法解决"System.Xml,版本= 2.0.0.0,区域性=中性,PublicKeyToken = 969db8053d3322ac,Retargetable =是"和"System.Xml,版本= 2.0.0.0,区域性=中性之间的冲突,PublicKeyToken = b77a5c561934e089".

No way to resolve conflict between "System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes" and "System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". Choosing "System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes" arbitrarily.

无法解决系统,版本= 2.0.0.0,区域性=中性,PublicKeyToken = 969db8053d3322ac,可重定位=是"和系统,版本= 2.0.0.0,区域性=中性,PublicKeyToken = b77a5c561934e089之间的冲突".

考虑对程序集"System.Windows.Forms,Culture = neutral,PublicKeyToken = 969db8053d3322ac,Retargetable = Yes"的app.config重新映射,从版本"1.0.5000.0" []到版本"3.5.0.0" [C :\ Program Files(x86)\ Microsoft.NET \ SDK \ CompactFramework \ v3.5 \ WindowsCE \ System.Windows.Forms.dll]解决冲突并摆脱警告.

我的代码中确实有这一行:

I do have this line in my code:

this.dtGridUPC = new System.Windows.Forms.DataGrid(); 

,尽管编译器警告我:"无法找到程序集"System.Windows.Forms.DataGrid".请检查并确保程序集在磁盘上.如果您的代码需要此引用,您可能会遇到编译错误."

and although the compiler warned me with this: "Could not locate the assembly "System.Windows.Forms.DataGrid". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors."

...我没有编译错误.

...I get no compilation errors.

越来越好奇.

推荐答案

您可以添加app.config文件,然后按如下所示映射库:

You can add an app.config file and then map the libraries like this:

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="dotless.ClientOnly" publicKeyToken="96b446c9e63eae34" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.3.1.0" newVersion="1.3.1.0" />
      </dependentAssembly>

这篇关于当编译器告诉我“考虑app.config重新映射"时,应该更改什么?当我没有app.config文件时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆