Reputation: 2436
I'm trying to use Xplot.Plotly in an f# project using Visual Studio for Mac. When I debug I obtain
"Could not load file or assembly
'FSharp.Core, Version=4.7.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
If If I do dotnet run I obtain:
Unhandled exception.
Cannot print exception string because Exception.ToString() failed.
the project file references are as follows
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MathNet.Numerics.FSharp" Version="4.9.1" />
<PackageReference Include="XPlot.Plotly" Version="3.0.1" />
<PackageReference Include="FSharp.Core" Version="4.7.1" />
</ItemGroup>
</Project>
and the project view screen shot as follows:
I'm not clear why VS shows 4.5.2 instead of 4.7.0.0?
I've also tried moving explicityly the Fsharp.core.dll version 4.7.0.0 to the bin directory. From the console the result is the same. If I run via Visual studio Fsharp.core.dll version 4.7.0.0 gets overwritten with 4.5.2.0 and fails in the same way as above.
Update: Workaround is simply do Clean from Visual Studio. and then run dotnet build from the console. Then you can debug from Visual Studio if needed.
Upvotes: 0
Views: 287
Reputation: 5015
Currently, VS for Mac requires Mono, which is locked to F# 4.5 and has numerous other troubles loading .NET Standard 2.0 components. Eventually, VS for Mac will be updated and it will support loading higher versions of the F# compiler and FSharp.Core.
Upvotes: 2