简体   繁体   中英

.NET Core mixed F# and C# project Intellisense not working

Problem

Given:

  • macOS 10.13.6
  • VSCode 1.40.1
    • C# package (powered by Omnisharp) 1.21.7
    • Ionide-fsharp 4.3.1
  • Mono 6.4.0.198 ( mono --version ) (installed via brew cask install mono-mdk or installed via the official macOS package)
  • MSBuild 16.3.0 ( msbuild -version )

I seem to be unable to get intellisense working on VS Code in a project that has to use F# from C#. I have a project in F# and one in C#. And the C# one has a reference to the F# one (to use some of the symbols contained in it).

Everything runs and builds correctly

What I did is this:

  • dotnet add reference the F# project to the C# project
  • dotnet restore the solution that contains both
  • dotnet build
  • dotnet run

And everything works fine on the command line.

On the other hand on VSCode I get "missing reference" errors for symbols defined in the F# project.

What have I tried?

I tried every combination of the following sets:

  1. Install Mono 6.4.0 (Visual Studio channel)
  2. Install Mono 6.4.0 (Stable channel)
  3. Install Mono from homebrew ( brew install mono )
  4. Install Mono from homebrew ( brew cask install mono-mdk )

and:

  1. Set "omnisharp.useGlobalMono": "always" in my settings.json for VS Code
  2. Set "omnisharp.useGlobalMono": "auto" in my settings.json` for VS Code

Between each attempt I have:

  • Cleaned all bin and obj folders from every project
  • Uninstalled other versions of Mono and MSBuild

References

I've read the following references but none of the solutions worked:

Neither OmniSharp nor Ionide recognize or handle mixed C#/F# solutions. Doing so would be an enormous amount of work - the equivalent machinery in Visual Studio is built by a fully staffed team, something open source plugins cannot afford to do.

Try changing settings for F# Extension, "Fsac Runtime" to "Net"
or "Mono" can't remember... don;t have a Mac right now

It did it for me few days ago

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM