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.
CodePudding user response:
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
CodePudding user response:
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.