How to solve the problem with System.Tuple set several times?

I am working on a target project of WP 7.5 and higher, I am adding packages using Nuget in VS 2012 called Coding4fun (Controls).

After that, the IDE will give me a warning,

Warning 1 The predefined type "System.Tuple" is defined in multiple assemblies in a global alias; using the definition from 'c: \ Users \ Gao \ Documents \ Visual Studio 2012 \ Projects \ TFSGit \ xicihutong \ packages \ Coding4Fun.Toolkit.Controls.2.0.5 \ lib \ wp71 \ Coding4Fun.Toolkit.Controls.dll' C: \ Users \ Gao \ Documents \ Visual Studio 2012 \ Projects \ TFSGit \ xicihutong \ xicihutong \ CSC xicihutong

The application is working fine, but how to solve this warning?

+4
source share
2 answers

From Compiler Warning (level 1) CS1685

This error occurs when a predefined system type, such as System.Tuple is in two assemblies. One way this can happen if you are referencing mscorlib from two different places, such as trying to run the.Net Framework version 1.0 and 1.1 side by side.

The compiler will use the definition from only one of the assemblies.

This problem probably occurs System.Tuple is defined in two different assemblies. Probably your Coding4Fun.Toolkit.Controls.dll also has mscorlib.dll value.

If you want to view them, you can check them out,

But how to solve this warning?

You can define your third-party assemblies by referencing some aliases. You can follow your project

 Reference -> Properties -> Aliases -> 

And change "global" to something else.

Check out extern alias (C# Reference) info extern alias (C# Reference)

+8
source

A new version of the c4f toolkit has resolved this problem.

+1
source

Source: https://habr.com/ru/post/1481140/


All Articles