fsprojects / fsharp-language-server

Other
214 stars 37 forks source link

Dotnet build doesn't work when VSCode is open and the project use project references #95

Closed MangelMaxime closed 2 years ago

MangelMaxime commented 3 years ago

It seems like having my project open in VSCode when using fsharp-language-server makes dotnet build fails.

FSC : error FS0078: Unable to find the file 'C:\Users\Maxime\Downloads\reproduction_fsharp_lsp\lib\Library.Base\bin\Debug\net5.0\Library.Base.dll' in any of↔ C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0↔ C:\Users\Maxime\Downloads\reproduction_fsharp_lsp↔ C:\Program Files\dotnet\sdk\5.0.202\FSharp\ [C:\Users\Maxime\Downloads\reproduction_fsharp_lsp\reproduction_fsharp_lsp.fsproj]
FSC : error FS0225: Source file 'C:\Users\Maxime\Downloads\reproduction_fsharp_lsp\obj\Debug\net5.0\reproduction_fsharp_lsp.AssemblyInfo.fs' could not be found [C:\Users\Maxime\Downloads\reproduction_fsharp_lsp\reproduction_fsharp_lsp.fsproj]

If I close VSCode and run dotnet build then everything is ok.

Reproduction:

  1. git clone git@github.com:MangelMaxime/FSharp.Language.Server-Reproduction-2.git
  2. Open the directory in VSCode
  3. Make sure the extension is loaded by hovering let test = "" in Library.fs
  4. Run dotnet build from the terminal
  5. It should fail
  6. Close VSCode
  7. Run dotnet build
  8. It should work

You can verify that the problem doesn't occur when no project reference is being used.

  1. Open the directory in VSCode
  2. Comment the project reference in the reproduction_fsharp_lsp.fsproj file
  3. Run dotnet build
  4. It should work even with VSCode open

The problem doesn't occur when using Rider, Ionide or VS so I think this is something specific to fsharp-language-server

stevenbrix commented 2 years ago

i'm hitting the same error, but it's in full VS and I don't have VSCode open. builds from the command line are working fine

faldor20 commented 2 years ago

Hey i just updated the readme sorry about the confusion "Untill I can sort out access to publishing new versions of the original extension, this is the working version of this extension F# Language Server updated"

Could you test with that version?

MangelMaxime commented 2 years ago

Hello @faldor20,

it seems to be fixed with your "fork".

Thank you