vscode-csharp: Debugging failed that "Could not locate .NET Core project. Assets were not generated.".

Environment data

dotnet --info output:

.NET Core SDK (reflecting any global.json):
 Version:   3.0.100-preview6-012103
 Commit:    d0d02f6552

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.13
 OS Platform: Darwin
 RID:         osx.10.13-x64
 Base Path:   /usr/local/share/dotnet/sdk/3.0.100-preview6-012103/

Host (useful for support):
  Version: 3.0.0-preview6-27728-04
  Commit:  b2f8fc281d

.NET Core SDKs installed:
  2.1.505 [/usr/local/share/dotnet/sdk]
  3.0.100-preview6-012103 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0-preview6-19278-02 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0-preview6-27728-04 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

VS Code version: 1.34 C# Extension version: 1.19 (v1.19.1)

Steps to reproduce

• Create new .NET Core 3.0 console application(con30) with reference to a .NET Standard 2.1 class library(cla21) via CLI, image • Open it via VSCode • Debug the app – Put breakpoint in the code and press F5, it shows a prompt message that “Could not find the task ‘build’”: image • Then open “launch.json”, press “Add Configuration…”, the “launch.json” file generator hasn’t updated the parts in <>. image • Run the ‘.NET: Generate Assets for Build and Debug’ command from command pallet, image

Expected behavior

Get a functional launch.json

Actual behavior

Could not locate .NET Core project. Assets were not generated. image

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 23 (2 by maintainers)

Most upvoted comments

I managed to solve the issue by following the steps from this comment: https://github.com/OmniSharp/omnisharp-vscode/issues/2509#issuecomment-420318250

As far as I can tell, the root cause of this problem has to do with the OmniSharp.MSBuild.ProjectManager. By attempting to fix the following error I managed to solve all the other subsequent errors:

Screen Shot 2019-07-18 at 9 41 24 PM

Same problem on 1.21.18 and .net core 3.1.201.

@omarfq can you copy/paste your OmniSharp log or open a new issue with it?

@gregg-miskelly sure. Just so you know, I created a console app using dotnet new console. When I open the folder where the project is located using the command code . I get this notification as soon as VSCode opens: Screen Shot 2019-07-18 at 7 06 46 PM

Here’s the OmniSharp Log (not sure if this is the one you are asking for):

Screen Shot 2019-07-18 at 7 33 50 PM Screen Shot 2019-07-18 at 7 34 17 PM

Here’s the launch.json file: Screen Shot 2019-07-18 at 7 38 12 PM

It is when I try to run the command .NET: Generate Assets for Build and Debug from the Command Pallette that I get the following error: Screen Shot 2019-07-18 at 7 39 31 PM

Not repro on 3.0.100-preview6-012234 (runtime-3.0.0-preview6-27730-01)(https://github.com/dotnet/core-sdk)

just occured to me too…