Closed EricM81 closed 3 weeks ago
RhinoCommon is transitioning from the .Net Framework to .Net Core
You say that, but it still only supports net48
.
This works fine in C#
It compiles, but I'm willing to bet that you'll get a run-time exception if you try to do anything. System.Drawing.Bitmap
appears to live in a different assembly on new versions of .NET.
Compilation error is the more reasonable outcome here in my opinion. If anything, C# is being too liberal in what it compiles. I know that oftentimes an old Framework library will just work, but the following warning is displayed for a reason
CsPlugin.csproj : warning NU1701: Package 'RhinoCommon 8.7.24138.15431' was restored using '.NETFramework,Version=v4.8.1' instead of the project target framework 'net7.0'. This package may not be fully compatible with your project.
I wouldn't be surprised if the F#'s [team's] policy was to simply consider this an unsupported scenario.
It compiles, but I'm willing to bet that you'll get a run-time exception if you try to do anything.
System.Drawing.Bitmap
appears to live in a different assembly on new versions of .NET.
I get that it looks weird, I don't know how or why they are doing this, but people are using this package to create cross-platform Win/Mac plugins on .Net Core with C#. It's only F# that can't compile.
https://developer.rhino3d.com/guides/rhinocommon/moving-to-dotnet-7/
@EricM81 -
The coreclr does not support desktop framework assemblies. As soon as you do significant work you will encounter missingmethod exceptions and typeload errors.
The runtime has some libraries for winforms workloads that run on the coreclr, you should port your baselibrary to that framework first. We haven't done any real work to ensure they are supported either, we are rather few developers, however we will certainly try to work with you to ensure that F# works well in that scenario moving forward.
BTW: the error failing your compile was not caused by but because F# doesn't allow you to assign null to bindings holding F# types by default. C# code allows the assignment of null to variables that are typed as reference types.
c:\kevinransom\RhinoCommonFsBug\FsPlugin\PluginInfo.fs(12,21): error FS0001: The type 'MyPlugin' does not have 'null' as a proper value. See also c:\kevinransom\RhinoCommonFsBug\FsPlugin\PluginInfo.fs(9,34)-(9,38).
CsPlugin succeeded with 2 warning(s) (1.9s) → CsPlugin\bin\Debug\net7.0\CsPlugin.dll
Kevin
Closing this as "by design".
RhinoCommon is transitioning from the .Net Framework to .Net Core. .Net Core is required for cross platform support. This works fine in C#, but won't work from F#.
Repro steps (https://github.com/EricM81/RhinoCommonFsBug):
1) Create a .Net Core 7 library in F#.
2) Add nuget package package:
<PackageReference Include="RhinoCommon" Version="8.7.24138.15431" />
3) Inherit the PlugIn class:
3) Compiler complains with "FS1109"
4) Do the same steps in c#. Compiles with no issues.