I am having a problem with the latest beta version of .net and the Xdocument library.
My project.json looks like this:
"dependencies": { "Microsoft.AspNet.Mvc": "6.0.0-beta4", "Microsoft.AspNet.Server.IIS": "1.0.0-beta4", "Microsoft.AspNet.Server.WebListener": "1.0.0-beta4", "Microsoft.AspNet.StaticFiles": "1.0.0-beta4", "System.Xml.XDocument": "4.0.10-beta-23109" }, "commands": { "web": "Microsoft.AspNet.Hosting --config hosting.ini" }, "frameworks": { "dnx451": { } },
And my code is as follows:
var xd = XDocument.Parse(str);
But I get an error message:
Severity Code Description Project File Line Error CS0433 The type 'XDocument' exists in both 'System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' and 'System.Xml.XDocument, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' WebApplication2.DNX 4.5.1 ValuesController.cs 23
Just trying to solve it using System.Xml.Linq.XDocument xd = or System.Xml.XDocument xd = does not work, what else can I try?
source share