当编译器告诉我“考虑 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?

查看:30
本文介绍了当编译器告诉我“考虑 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:

考虑从版本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, 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".

无法解决System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes"和System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"之间的冲突".任意选择System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes".

考虑从版本1.0.5000.0"[] 到版本3.5.0.0"[C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Windows.Forms.dll] 解决冲突并消除警告.

我的代码中有这一行:

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天全站免登陆