System.Xml.sln fails to build on Mono, error CS0433
I know that cross-platform support is coming later, I just thought it might make sense to document this here in case someone else tries the same
Building System.Xml.sln with xbuild on Mono doesn't work (the other solutions build fine), it throws the following errors:
Build FAILED.
Errors:
/home/alexander/dev/corefx/src/System.Xml.sln (default targets) ->
(Build target) ->
/home/alexander/dev/corefx/src/System.Xml.XPath.XDocument/System.Xml.XPath.XDocument.csproj (default targets) ->
/usr/lib/mono/4.5/Microsoft.CSharp.targets (CoreCompile target) ->
System/Xml/XPath/XAttributeExtensions.cs(10,56): error CS0433: The imported type `System.Xml.Linq.XAttribute' is defined multiple times
System/Xml/XPath/XAttributeExtensions.cs(10,78): error CS0433: The imported type `System.Xml.Linq.XNamespace' is defined multiple times
System/Xml/XPath/XDocumentExtensions.cs(22,61): error CS0433: The imported type `System.Xml.Linq.XNode' is defined multiple times
System/Xml/XPath/XObjectExtensions.cs(10,23): error CS0433: The imported type `System.Xml.Linq.XContainer' is defined multiple times
System/Xml/XPath/XObjectExtensions.cs(10,49): error CS0433: The imported type `System.Xml.Linq.XObject' is defined multiple times
System/Xml/XPath/XNodeNavigator.cs(48,9): error CS0433: The imported type `System.Xml.Linq.XElement' is defined multiple times
System/Xml/XPath/XNodeNavigator.cs(784,35): error CS0433: The imported type `System.Xml.Linq.XText' is defined multiple times
It looks like it runs into a conflict with the System.Xml.Linq library in the Mono GAC. Needs further investigation.
Shouldn't be a GAC conflict as the compiler oughtn't be resolving libraries from the GAC, right? Is there a way to run the build with diagnostic output and see what the generated compiler invocation(s) are?
@bojanrajkovic, yes; by changing /verbosity:minimal to /verbosity:detailed at build.cmd#L29.
I looked a bit more into this, the exact error generated by the compiler for the System.Xml.XPath.XDocument.csproj project is:
System/Xml/XPath/XAttributeExtensions.cs(10,56): error CS0433: The imported type `System.Xml.Linq.XAttribute' is defined multiple times
/home/alexander/dev/corefx/src/System.Xml.XDocument/bin/Debug/System.Xml.XDocument//System.Xml.XDocument.dll (Location of the symbol related to previous error)
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile7/System.Xml.XDocument.dll (Location of the symbol related to previous error)
So the issue seems to be that it references System.Xml.XDocument.dll from both the project and the PCL-Profile7 libraries. I tested that removing the project reference from System.Xml.XPath.XDocument.csproj makes it compile.
Yesterday, @shanselman invited @migueldeicaza on stage (watch http://channel9.msdn.com/Events/Visual-Studio/Connect-event-2014/014 17 min onwards), where he cloned this repo under mono: https://github.com/mono/corefx.
Not sure about the strategy, but probably, they will enable comments via their fork settings and mono-related issues will be redirected there? Or may be if you figure out the fix, you can send a PR to mono/corefx which will ultimately be merged back to this original repo .. :smiley:
@akoeplinger Is this still an issue? I suspect it would have been fixed by the System.Xml sln split.
@nguerrera Ah sorry, yeah this has long been fixed (even before the sln split) :)