Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET - "Data at the root level is invalid" error while browsing Nuget Packages in VS 2017

I'm trying to create a .NET Web API Application and install EntityFramework using Nuget Package Manager.

But when I'm going to : Right Click on Project References > Manage Nuget Packages > Browse I can't find Microsoft.EntityFrameworkCore in the list.

Then I'm having this error showing at the bottom, in the output section :

[nuget.org] Data at the root level is invalid. Line 1, position 1.

I use VS 2017 15.5.2 and .Net Framework 4.7.02556.

I also get this error when using the dotnet cli command dotnet add package Microsoft.EntityFrameworkCore :

error: The content at 'https://api.nuget.org/v3/index.json/FindPackagesById()?id='Microsoft.EntityFrameworkCore'' is not valid XML. error: Data at the root level is invalid. Line 1, position 1.

It looks like that the dotnet cli is trying to load the remote index.json file as a XML file.

For your information, dotnet --version is showing 2.1.3.

Any idea?

like image 269
Jeremie P Avatar asked Oct 28 '25 13:10

Jeremie P


1 Answers

Using VS 2019, my solution was to Clear All NuGet Cache(s).

This can be achieved through Options -> NuGet Package Manager -> General -> Clear All NuGet Cache(s).

like image 183
code Avatar answered Oct 30 '25 02:10

code



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!