Reputation:
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?
Upvotes: 4
Views: 5656
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
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
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
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