CS0433:两者中都存在“List ”类型

我尝试使用.net核心,但我有很多不同的问题。 这是其中之一。 我使用的是Ubuntu 14。

错误代码

Microsoft.Dnx.Compilation.CSharp.RoslynCompilationException: /home/lukasz/Project/Commands.cs(10,16): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/Commands.cs(10,21): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/DataManager.cs(16,17): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/DataManager.cs(16,22): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/DataManager.cs(17,17): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/DataManager.cs(18,17): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/DataManager.cs(25,28): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/DataManager.cs(25,33): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/Results/Participant.cs(128,16): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/Results/Participant.cs(133,40): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/Results/Participant.cs(14,17): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/Results/SessionResult.cs(23,16): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/Results/SessionResult.cs(28,41): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/Results/SessionResult.cs(9,17): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/Commands.cs(18,33): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/Commands.cs(18,38): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/Commands.cs(29,34): DNX,Version=v4.5.1 warning CS0168: The variable 'e' is declared but never used /home/lukasz/Project/DataManager.cs(29,29): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/DataManager.cs(46,29): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/DataManager.cs(83,29): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/DataManager.cs(83,71): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/DataManager.cs(97,48): DNX,Version=v4.5.1 error CS0012: The type 'Type' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. /home/lukasz/Project/DataManager.cs(98,28): DNX,Version=v4.5.1 error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. /home/lukasz/Project/DataManager.cs(98,17): DNX,Version=v4.5.1 error CS0012: The type 'Stream' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.IO, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. /home/lukasz/Project/DataManager.cs(98,17): DNX,Version=v4.5.1 error CS0012: The type 'TextWriter' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.IO, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. /home/lukasz/Project/DataManager.cs(98,38): DNX,Version=v4.5.1 error CS1503: Argument 1: cannot convert from 'System.IO.MemoryStream' to 'System.Xml.XmlWriter' /home/lukasz/Project/DataManager.cs(161,36): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/DataManager.cs(165,17): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/DataManager.cs(241,42): DNX,Version=v4.5.1 error CS0012: The type 'Type' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. /home/lukasz/Project/DataManager.cs(243,17): DNX,Version=v4.5.1 error CS0246: The type or namespace name 'XmlTextWriter' could not be found (are you missing a using directive or an assembly reference?) /home/lukasz/Project/DataManager.cs(243,43): DNX,Version=v4.5.1 error CS0246: The type or namespace name 'XmlTextWriter' could not be found (are you missing a using directive or an assembly reference?) /home/lukasz/Project/DataManager.cs(243,61): DNX,Version=v4.5.1 error CS0433: The type 'Encoding' exists in both 'System.Text.Encoding, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' /home/lukasz/Project/DataManager.cs(245,29): DNX,Version=v4.5.1 error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. /home/lukasz/Project/DataManager.cs(245,24): DNX,Version=v4.5.1 error CS0012: The type 'Stream' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.IO, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. /home/lukasz/Project/DataManager.cs(245,24): DNX,Version=v4.5.1 error CS0012: The type 'TextReader' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.IO, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. /home/lukasz/Project/DataManager.cs(245,41): DNX,Version=v4.5.1 error CS1503: Argument 1: cannot convert from 'System.IO.MemoryStream' to 'System.Xml.XmlReader' /home/lukasz/Project/Results/Participant.cs(27,35): DNX,Version=v4.5.1 error CS0433: The type 'List' exists in both 'System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' at Microsoft.Dnx.ApplicationHost.Program.Main (System.String[] args) [0x00000] in :0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in :0 at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in :0 at Microsoft.Dnx.Host.Bootstrapper.RunAsync (System.Collections.Generic.List`1 args, IRuntimeEnvironment env, System.Runtime.Versioning.FrameworkName targetFramework) [0x00000] in :0 

我尝试了不同的方法,但没有人帮助我。

这是我的project.json文件

 { "version": "1.0.0-*", "dependencies": { "System.Xml.XmlSerializer": "4.0.10-beta-*" }, "frameworks": { "dnx451": { "dependencies":{} }, "dnxcore50": { "dependencies": { "System.Console": "4.0.0-beta-*" } } } } 

任何人都可以帮助我?


我的新工作project.json

 { "version": "1.0.0-*", "dependencies": { }, "frameworks" : { "dnx451" : { "frameworkAssemblies": { "System.Xml": "4.0.0.0" } }, "dnxcore50" : { "dependencies": { "System.Console": "4.0.0-beta-*", "System.Xml.XmlSerializer": "4.0.10-beta-*" } } } } 

尝试将System.Xml.XmlSerializer移动到dnxcore50依赖项。 dnx451已经有了XmlSerializer类,所以它不需要System.Xml.XmlSerializer包(取决于System.Collections包)