Search code examples
visual-studiovisual-studio-2022

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


Solution

  • 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).