You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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'.
The text was updated successfully, but these errors were encountered:
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'.
The text was updated successfully, but these errors were encountered: