Skip to content

Discussion about moving FSharp.Core to netstandard 2.0 only #7550

@KevinRansom

Description

@KevinRansom

So I have a PR, weirdly enough it's a pretty big one: #7463

It builds a nuget package with only a netstandard2.0 build of FSharp.Core.dll. That means no desktop specific FSharp.Core after F# 5.0. Well, a developer can always use the FSharp.Core 4.7 nuget package for that scenario.

Apps built using it, will only be able to run on .Net4.6.1 or up. However, I believe the recommended desktop framework to use for netstandard2.0 compatability is .NET 4.7.2

It has an identical set of public APIs to the net472 build in 4.6.*. so FSharp.Core compatability shouldn't be an issue.

There is a slight issue with command line compilation.

When building an .fsproj file msbuild does a great job of collecting all of the required and possibly required references.

However, if a developer manually types:

   fsc program.fs -r:SomePathTo\FSharp.Core.dll

the compiler says … hmmm you better specify your framework assemblies too
specifically:

error FS1222: When mscorlib.dll or FSharp.Core.dll is explicitly referenced the --noframework option must also be passed

That requires the developer to specify the framework assemblies required. The compiler helps out with mscorlib.dll and if you omit it, it finds one anyway.

Unfortunately, with this change you need to tell the build to look for: netstandard.dll, System.Numerics.dll and System.dll

I am conflicted about whether to do this automagically … because the developer was required to specify … --noframework . The reason I have any conflict, is the compiler helpfully will find mscorlib.dll even though the developer said --noframework.

Specifying these paths is only required if a developer paths to FSharp.Core.dll, if the developer omits that reference then we automagically find everything needed. We do this a lot in our testing, but in the real world, I hope it rarely happens at all. Indeed Ideally a developer will always use a .fsproj to specify the build.

Anyway comments … suggestions …

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions