vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Could not locate .NET Core project in F# project

Open Jisu-Woniu opened this issue 3 years ago • 0 comments

Issue Description

When running in directory of F# Project (*.fsproj), running ".NET: Generate Assets for Build and Debug" produces: "Could not locate .NET Core project. Assets were not generated."

Steps to Reproduce

On Linux with .NET 6.0 SDK installed, run the following command to create a F# project with a solution file.

dotnet new console -lang F# -o FSharpProject
cd FSharpProject/
dotnet new sln
dotnet sln add .
code .

In VS Code, run ".NET: Generate Assets for Build and Debug" from Command Palette.

Expected Behavior

The config for Debug generated in .vscode/tasks.json and .vscode/launch.json so that "Ionide for F#" plugin can debug the F# project.

Actual Behavior

An error message appeared: "Could not locate .NET Core project. Assets were not generated."

F# plugin relies on OmniSharp plugin's assets to debug F# apps, but it seems OmniSharp refuses to generate them in F# project directory.

Logs

OmniSharp log

Starting OmniSharp server at 2022/7/11 19:16:29 Target: /home//FSharpProject/FSharpProject.sln

OmniSharp server started with .NET 6.0.301 . Path: /home//.vscode/extensions/ms-dotnettools.csharp-1.25.0-linux-x64/.omnisharp/1.39.0-net6.0/OmniSharp.dll PID: 61734

Starting OmniSharp on Unknown 0.0 (Unknown) info: OmniSharp.Services.DotNetCliService Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK info: OmniSharp.Services.DotNetCliService Using the 'dotnet' on the PATH. info: OmniSharp.Services.DotNetCliService DotNetPath set to dotnet info: OmniSharp.MSBuild.Discovery.MSBuildLocator Located 1 MSBuild instance(s) 1: .NET Core SDK 6.0.301 17.2.0 - "/usr/share/dotnet/sdk/6.0.301/" info: OmniSharp.MSBuild.Discovery.MSBuildLocator Registered MSBuild instance: .NET Core SDK 6.0.301 17.2.0 - "/usr/share/dotnet/sdk/6.0.301/" info: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0 info: OmniSharp.MSBuild.ProjectSystem Detecting projects in '/home//FSharpProject/FSharpProject.sln'. info: OmniSharp.Script.ScriptProjectSystem Detecting CSX files in '/home//FSharpProject'. info: OmniSharp.Script.ScriptProjectSystem Did not find any CSX files info: OmniSharp.WorkspaceInitializer Configuration finished. info: OmniSharp.Stdio.Host Omnisharp server running using Stdio at location '/home//FSharpProject' on host 61439.

C# log

No content

Environment information

VSCode version: 1.69.0 C# Extension: 1.25.0 Ionide for F#: 6.0.6

Mono Information OmniSharp using mono :6.8.0
Dotnet Information .NET SDK: Version: 6.0.301 Commit: 43f9b18481

Runtime Environment: OS Name: ubuntu OS Version: 22.04 OS Platform: Linux RID: ubuntu.22.04-x64 Base Path: /usr/share/dotnet/sdk/6.0.301/

Host (useful for support): Version: 6.0.6 Commit: 7cca709db2

.NET SDKs installed: 6.0.301 [/usr/share/dotnet/sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 6.0.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

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

Jisu-Woniu avatar Jul 11 '22 11:07 Jisu-Woniu