Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FSharpCompilerService not working on .NETCore 3.1.12 due to mismatch version of the App ref directory #963

Closed
gmoneh opened this issue Feb 17, 2021 · 1 comment

Comments

@gmoneh
Copy link

gmoneh commented Feb 17, 2021

Runtime: .NET Core 3.1.12

When using FSharp Compiler Services (in my case via FsiEvaluationSession.Create() ), a System.IO.DirectoryNotFoundException: 'Could not find a part of the path 'C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\3.1.12\ref'.' is thrown.

The reason for this is the algorithm used to find the ref directory. According to this comment in the FSharp.Compiler.Service/DotNetFrameworkDependencies.fs:

// use the well know location for obj to traverse the file system towards the
//
// packs\Microsoft.NETCore.App.Ref\sdk-version\netcoreappn.n
// we will rely on the sdk-version match on the two paths to ensure that we get the product that ships with the
// version of the runtime we are executing on

The problem is that, in a .NETCore 3.1.12 installation, those do not match, rendering this algorithm incorrect.

On my computer, for example, the location of obj (.NET base implementation) is C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.12.

According to the algorithm implemented in the file referenced above, it goes to look for these dependencies at: 'C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\3.1.12\ref', but this directory does not exist. The .NET Core directory on that folder is 'C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\3.1.10\ref'.

@baronfel
Copy link
Collaborator

Please open this issue in dotnet/fsharp, this repo is no longer in active development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants