'Microsoft VS 2022 with .net 6.0 Error: The debug executable ...debug profile does not exist
I started to learn C# and .net and just installed Microsoft VS 2022 and also installed .net 6.0. I was trying to run the first code and it came up the error as follows. I did some research but can't figure out what's wrong. I noticed there is a similar question on StackOverflow before I tried the answers but didn't work. Can anyone help please? The error message: The debug executable 'C:\user\owener\source\repos\ConsoleApp2\ConsoleApp2\bin\Debug\net6.0\ConsoleApp2.exe'specified in the 'ConsoleApp2' debug profile does not exist.
Output showing error message:error NETSDK1004: Assets file 'C:\user\owener\source\repos\ConsoleApp2\ConsoleApp2\obj\project.assets.json'not found. Run a NuGet package restore to generate this file.
Solution 1:[1]
Select Tools->NuGet Package Manager -> Package Manager Console and type
dotnet restore
or you can first go in settings and search for Nuget->General and Clear the Caches
Solution 2:[2]
It is all fixed now. debug, Nuget, PowerShell are all working. I just uninstalled VS 2022 and reinstalled VS 2019 and ticked all extra optional when choosing .Net desktop development. I guess I'm missing some software in my computer system.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Martin Bartolomé |
| Solution 2 | chengxuyuan9527 |
