Unable to start debugging. The startup project can

2019-06-25 01:17发布

I'm trying .NET Core today inside Visual Studio 2017. However, it seems I'm unable to debug the application even with barebone Hello World project.

Every time I try to start the project, the following message box appear:

Error Message

I've searched similar issue and come across this thread: Unable to start debugging. The startup project could not be launched. VS2015

I tried every single answer there and nothing worked in my end.
Is there something I missed?

Thanks in advance

3条回答
ら.Afraid
2楼-- · 2019-06-25 01:53

I had the same problem (Visual Studio 17.3 and 17.4). I was able to solve today. It turned out that the cause was an extension. After deactivating this extension I was able to debug again.

Edit: In my case it was the "Arduino GDB for Visual Micro 2017".

查看更多
Root(大扎)
3楼-- · 2019-06-25 01:56

After experiencing the error dialog in the original question and I followed the suggestions provided here and on similar SO topics, with no success. Thinking my project was the problem I created a brand new, "Hello World" .NET Core console application.

I could not start the debugger from this brand new project as well. I decided this was a problem beyond my project or solution files. So I decided to repair my Visual Studio 2017 installation, I was running VS 2017 15.5.1.

To repair VS 2017... start Visual Studio Installer, under the Installed section\Visual Studio Professional (my edition is Professional), look for the More [down arrow] option to the right of [Modify] and [Launch], from the More drop-down choose Repair.

This took quite some time (I left for a couple hours), but upon return both the new Hello World and my NETCore application would launch in the debugger.

查看更多
\"骚年 ilove
4楼-- · 2019-06-25 02:14

Under your solution (not project), there should be a file called global.json with content like this:

"sdk": {
   "version": "1.0.0-blah-blah"
}

Go to the command line and run: dotnet --version. This will give you the default dotnet version. Replace "version" value with that, save the solution, restart Visual Studio and give it a shot again.

查看更多
登录 后发表回答