Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What should I change when the compiler tells me to "Consider app.config remapping" when I have no app.config file?

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:

Consider app.config remapping of assembly "System.Windows.Forms, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes" from Version "1.0.5000.0" [] to Version "2.0.0.0" [C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE\System.Windows.Forms.dll] to solve conflict and get rid of warning.

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

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

UPDATE

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

C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3245: Could not resolve this reference. 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.

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.

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

Consider app.config remapping of assembly "System.Windows.Forms, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes" from Version "1.0.5000.0" [] to Version "3.5.0.0" [C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Windows.Forms.dll] to solve conflict and get rid of warning.

UPDATE 2

I do have this line in my code:

this.dtGridUPC = new 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.

Curiouser and curiouser.

like image 668
B. Clay Shannon-B. Crow Raven Avatar asked Oct 03 '13 16:10

B. Clay Shannon-B. Crow Raven


1 Answers

Please use Auto-generate binding redirects at project properties window in Visual Studio

enter image description here

like image 71
Behzad Ebrahimi Avatar answered Oct 30 '22 06:10

Behzad Ebrahimi