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

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

I created two projects and the following:

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 link to the project in ClassLibrary from the main program.

dotnet add reference ..\ClassLibrary\ClassLibrary.fsproj

I updated Program.cs to call 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 that I open the solution folder in Visual Studio code.

  • When I open Program.cs, the red editor emphasizes that there are no F # library types.
  • When I open Library.fs, the red-editor emphasizes almost everything. Interestingly, the errors are from the C # compiler, not from the F # compiler.
  • Ctrl-Shift-B creates projects with 0 warnings and 0 errors.
  • VSCode Windows 12 .

enter image description here

enter image description here

.

  • VS- F #, Intellisense .
  • VS- #, - F #.

VS 1.15.1 .

  • #, 1.12.1
  • Ionide-fsharp, 2.33.0
  • PL/SQL, 1.0.4
  • Mono Debug, 0.15.7
  • XML Tools, 1.9.2
+4
1

, .

Visual Studio Build Tools 2017, F #.

0

Source: https://habr.com/ru/post/1683861/


All Articles