user17682078
user17682078

Reputation:

How to fix "NuGet.Config is not valid XML" error on VS Community 2022?

I installed Visual Studio Community 2022 and I tried to create a Windows Form Application named AnalogueClock on .NET Framework (version 4.7.2), but I got the error message ("NuGet operation failed. NuGet.Config is not valid XML") below. How can I fix this?

Screenshot of error message

Upvotes: 4

Views: 5656

Answers (4)

Yuvraj Singh
Yuvraj Singh

Reputation: 69

For Me I follow these Path:- c:/Users/{YourUserName}/AppData/Roming/NuGet/Nuget.XML then Delete Configuration File and Just reopen your project. And You Found Your Nuget Project are working.

Upvotes: 0

Matt Nelson
Matt Nelson

Reputation: 991

The resolution for me was to ensure the encoding of the file was the same as the encoding specified in the XML header of the file which was UTF8.

Upvotes: 0

Kirsten
Kirsten

Reputation: 18036

For me the problem was I had an old nuget feed that had an @ in the name. This seems to be no longer supported.

Upvotes: 0

PMF
PMF

Reputation: 17185

It's very likely that the indicated file is corrupt. Normally, you should be able to just delete it, it will get recreated with default contents (keep a backup, in case you need it).

Upvotes: 3

Related Questions