There are three versions of FSharp.Core relevant to the operation of FSharp.Compiler.Service:
The FSharp.Compiler.Service.dll static reference to FSharp.Core - The FCS DLL and nuget have a static minbound dependency on FSharp.Core.
This is just a normal .NET dependency like any other, it expresses the minimum surface area of FSharp.Core that the implementation of FSharp.Compiler.Service (and any components that depend on it) needs. It could be a reference to a reference assembly if we supported that. In theory this could be very low and all is cool - if we could implement FCS in terms of FSharp.Core 126.96.36.199 then that could be the minbound (indeed in theory we could implement FCS pretty almost without any use of FSharp.Core functionality at all, though obviously we don't).
In practice this is 0-2 versions behind latest FSharp.Core.
The runtime reference to FSharp.Core in a tool, application or test suite that includes FSharp.Compiler.Service - This is the actual version of FSharp.Core used when, say, fsc.exe or devenv.exe or fsi.exe or fsdocs.exe runs.
This must be at least as high as (1) and is usually the very latest FSharp.Core available (in or out of repo tree). This is important to the operation of the FCS-based tool because it is used for execution of scripts, and the default compilation reference for scripts. If scripts are going to use a particular language feature then this must be sufficient to support the language feature.
The FSharp.Core reference in a compilation or analysis being processed by FSharp.Compiler.Service.
This can be anything - 188.8.131.52, 184.108.40.206 or 5.0.0 or whatever. For script compilation and execution is the same as (2). It must be sufficient to support language features used in the compilation.
When building applications or plug-in components which use FSharp.Compiler.Service.dll, you will normally also include a copy of FSharp.Core.dll as part of your application.
For example, if you build a
HostedCompiler.exe, you will normally place an FSharp.Core.dll (say 220.127.116.11) alongside
The FSharp.Compiler.Service component can be used to do more or less any sort of F# compilation. In particular you can reference an explicit FSharp.Core and/or framework assemblies in the command line arguments (different to the FSharp.Core and a .NET Framework being used to run your tool).
If you do not explicitly reference an FSharp.Core.dll from an SDK location, or if you are processing a script
GetProjectOptionsFromScript, then an implicit reference to FSharp.Core will be made
by the following choice:
- The version of FSharp.Core.dll for the SDK implied by global.json.
The version of FSharp.Core.dll statically referenced by the host assembly returned by
- If there is no static reference to FSharp.Core in the host assembly, then a default is chosen.
NOTE: these may depend on exact flags passed to