Code Monkey home page Code Monkey logo

Comments (4)

kerams avatar kerams commented on September 27, 2024

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.

from fsharp.

EricM81 avatar EricM81 commented on September 27, 2024

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/

from fsharp.

KevinRansom avatar KevinRansom commented on September 27, 2024

@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

from fsharp.

KevinRansom avatar KevinRansom commented on September 27, 2024

Closing this as "by design".

from fsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.