4

I'm trying to deploy on .net 4.6 (which is what azure apps use), so I'm referencing the latest fsharp.core compatible with that framework on my .fsproj, which is <TargetFSharpCoreVersion>4.4.0.0</TargetFSharpCoreVersion>

But on my code I'm using Suave 2.0.0-rc8, which references some fsharp.core 4.0.0.1, the one that is available from nuget.

But somehow, it works! Can anybody give me an explanation even if it is a bit simplistic of how it works? How can there be two fsharp.cores, it seems it is not as core as it sounds.

:s

Lay González
  • 2,901
  • 21
  • 41

1 Answers1

3

The NuGet version of FSharp.Core is not equal to the assembly version of FSharp.Core.

The versioning scheme for FSharp.Core is confusing, but when you use FSharp.Core in a .NET 4.6 application, the assembly version is 4.4.0.0, even though it's bundled in a NuGet package with the version 4.0.0.1.

You can investigate this yourself inside of Visual Studio. As an example, I have a small application that has these NuGet dependencies:

Id                                  Versions 
--                                  -------- 
FsCheck                             {2.6.2}  
FsCheck.Xunit                       {2.6.2}  
FSharp.Core                         {4.0.0.1}
Unquote                             {3.1.2}  
xunit.abstractions                  {2.0.0}  
xunit.extensibility.core            {2.1.0}  
xunit.extensibility.execution       {2.1.0}  

You will notice that the NuGet version of FSharp.Core is 4.0.0.1.

If you find the reference in Solution Explorer, you can find the actual .dll file that contains FSharp.Core. If you open this with Reflector or the Visual Studio object browser, you'll see that the assembly version is, in fact, 4.4.0.0.

Community
  • 1
  • 1
Mark Seemann
  • 225,310
  • 48
  • 427
  • 736
  • Sí, if I'm already referencing 4.4.0.0 I shouldn't need to reference 4.0.0.1 or I still need to reference just because they're strictly speaking not the same and some libraries declare one as their dependency and other libraries declare the other as their dependency? – Lay González Jan 03 '17 at 06:50
  • 3
    @LayGonzález See updated answer. The _assembly_ FSharp.Core 4.4.0.0 is bundled in the _NuGet package_ FSharp.Core 4.0.0.1. – Mark Seemann Jan 03 '17 at 06:52
  • Now I see! one is an assembly, the other is a package. Thanks a lot! – Lay González Jan 03 '17 at 06:54