jpowell
jpowell

Reputation: 21

XDocument NuGet Package won't install

In my application I'm trying to read XML files and was attempting to use the System.Xml.Linq utilities. I'm using the .net framework 4.6.1 and trying to install the System.Xml.XDocument NuGet package for that purpose.

When I try to install it from the Package Manager, it seems to install correctly (gains the checkmark in the browse tab of manager), but when I check the installed packages, it doesn't show up. I go back to browse on the package manager and it is back to not being installed in my project. I tried installing via the console, but got this error:

Error finding repository for 'https://www.nuget.org/api/v2/curated-feeds/microsoftdotnet/': An error occurred while retrieving package metadata for 'System.Xml.XDocument.4.3.0' from source 'Microsoft and .NET'. A task was canceled.

So I downloaded the NuGet Package from NuGet.org and dumped it in a folder on my computer, tried installing it from there and it seemed to work, the console no longer producing errors, but I was still getting the same behavior in the Package Manager.

I've deleted my project.json.lock file and done a dotnet restore command a few times while trying to figure this out, but I've hit something of a brickwall in what I can do to get this package installed and usable.

In the meantime I've installed and am using the System.Xml.XmlDocument NuGet Package, so at the very least I know I can install other packages.

Upvotes: 0

Views: 1262

Answers (1)

jpowell
jpowell

Reputation: 21

After working with the member of my team who knows far more about NuGet Packages than I, he pointed it out to me that System.Xml.XDocument isn't supported while using the .Net 4.6.1 Framework. The correct Package to use is/was System.Xml.XPath.XDocument.

Would have been nice to have some indication of that in Package Manager instead of the installed package just uninstalling itself, but That is going to be a marker for me to look for that in the future.

Upvotes: 2

Related Questions