Wallace
Wallace

Reputation: 17379

Can Visual Studio Code work with mixed-language, .NET Core solutions?

Is there a simple fix for the following? Or is this a bug in VSCode and/or the language-specific extensions?

I created two projects and a solution like this:

dotnet new library -lang F# -o .\ClassLibrary
dotnet new console -lang C# -o .\MainProgram
dotnet new sln
dotnet sln add .\ClassLibrary\ClassLibrary.fsproj
dotnet sln add .\MainProgram\MainProgram.csproj

I added a project reference to the ClassLibrary from within the MainProgram.

dotnet add reference ..\ClassLibrary\ClassLibrary.fsproj

I updated the Program.cs to call the ClassLibrary.

static void Main(string[] args)
{
    ClassLibrary.Say.hello("world.");
}

I can restore, build, and run the program successfully.

dotnet restore
dotnet run -p .\MainProgram\MainProgram.csproj

The problem is when I open the solution folder in Visual Studio Code.

enter image description here

enter image description here

I have also tried opening the project folders separately.

Update

I have VS Code version 1.15.1, with five extensions installed.

  1. C#, 1.12.1
  2. Ionide-fsharp, 2.33.0
  3. Language PL/SQL, 1.0.4
  4. Mono Debug, 0.15.7
  5. XML Tools, 1.9.2

Upvotes: 5

Views: 955

Answers (1)

Wallace
Wallace

Reputation: 17379

Looks like we just need to wait for this fix.

And, if you have Visual Studio Build Tools 2017 installed, update to the latest version and F# compiler workload.

Upvotes: 1

Related Questions