Skip to content

Commit 5e3b229

Browse files
committed
update docs
1 parent f915b7a commit 5e3b229

File tree

1 file changed

+28
-30
lines changed

1 file changed

+28
-30
lines changed

docs/content/corelib.fsx

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,34 @@ Shipping an FSharp.Core with your application
88
---------------------------------------------
99
1010
11-
When building applications or plug-in components which use ``FSharp.Compiler.Service.dll``, you will normally need
12-
to ship a copy of ``FSharp.Core.dll`` as part of your application.
11+
When building applications or plug-in components which use FSharp.Compiler.Service.dll, you will normally need
12+
to ship a copy of FSharp.Core.dll as part of your application.
1313
14-
For example, if you build a HostedCompiler.exe, you will normally place an ``FSharp.Core.dll`` (say 4.3.1.0) alongside
14+
For example, if you build a HostedCompiler.exe, you will normally place an FSharp.Core.dll (say 4.3.1.0) alongside
1515
your HostedCompiler.exe.
1616
17-
Sometimes you will also need to include an ``FSharp.Core.optdata`` and ``FSharp.Core.sigdata``, see below.
17+
If doing dynamic compilation and execution you may also need to include
18+
an FSharp.Core.optdata and FSharp.Core.sigdata, see below.
1819
1920
Binding redirects for your application
2021
--------------------------------------
2122
22-
The ``FSharp.Compiler.Service.dll`` component depends on FSharp.Core 4.3.0.0. Normally your application will target
23+
The FSharp.Compiler.Service.dll component depends on FSharp.Core 4.3.0.0. Normally your application will target
2324
a later version of FSharp.Core. This means you will also need a binding-redirect file to make sure
24-
that FSharp.Core 4.3.0.0 forwards to which ever final version of ``FSharp.Core.dll`` your application runs correctly.
25+
that FSharp.Core 4.3.0.0 forwards to which ever final version of FSharp.Core.dll your application runs correctly.
2526
Binding redirect files are normally generated automatically by build tooling. If not, you can use a
2627
27-
``
28-
<?xml version="1.0" encoding="utf-8" ?>
29-
<configuration>
30-
<runtime>
31-
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
32-
<dependentAssembly>
33-
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
34-
<bindingRedirect oldVersion="2.0.0.0-4.3.0.0" newVersion="4.3.1.0"/>
35-
</dependentAssembly>
36-
</assemblyBinding>
37-
</runtime>
38-
</configuration>
39-
``
28+
<?xml version="1.0" encoding="utf-8" ?>
29+
<configuration>
30+
<runtime>
31+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
32+
<dependentAssembly>
33+
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
34+
<bindingRedirect oldVersion="2.0.0.0-4.3.0.0" newVersion="4.3.1.0"/>
35+
</dependentAssembly>
36+
</assemblyBinding>
37+
</runtime>
38+
</configuration>
4039
4140
Which FSharp.Core and .NET Framework gets referenced in compilation?
4241
--------------------------------------
@@ -48,32 +47,31 @@ assemblies in the command line arguments (different to the FSharp.Core and a .NE
4847
To target a specific FSharp.Core and/or .NET Framework assemblies, use the ``--noframework`` argument
4948
and the appropriate command-line arguments:
5049
51-
let errors2, exitCode2 =
50+
let errors2, exitCode2 =
5251
scs.Compile([| "fsc.exe"; "--noframework"; "-r"; @"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.1.0\FSharp.Core.dll"; "-r"; @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll"; "-o"; fn3; "-a"; fn2 |])
5352
54-
55-
5653
You will need to determine the location of these assemblies. The easiest ways to locate these DLLs in a cross-platform way and
5754
convert them to command-line arguments is to [crack an F# project file](http://fsharp.github.io/FSharp.Compiler.Service/project.html).
5855
Alternatively you can compute SDK paths yourself, and some helpers to do this are in [the tests for FSharp.Compiler.Service.dll](https://github.com/fsharp/FSharp.Compiler.Service/blob/8a943dd3b545648690cb3bed652a469bdb6dd869/tests/service/Common.fs#L54).
5956
6057
61-
Do I need to include ``FSharp.Core.optdata`` and ``FSharp.Core.sigdata``?
58+
Do I need to include FSharp.Core.optdata and FSharp.Core.sigdata?
6259
--------------------------------------
6360
64-
If your compilation arguments explicitly reference an ``FSharp.Core.dll`` from an SDK location, then ``FSharp.Core.sigdata`` and ``FSharp.Core.optdata`` should be alongside the DLL
61+
If your compilation arguments explicitly reference an FSharp.Core.dll from an SDK location, then FSharp.Core.sigdata and FSharp.Core.optdata should be alongside the DLL
6562
(if these files are not installed, then that's a bug in the F# SDK installation). If your compilation
66-
arguments are always making an explicit reference, then you should _not_ include ``FSharp.Core.optdata`` and ``FSharp.Core.sigdata`` as part of your application.
63+
arguments are always making an explicit reference, then you should _not_ include FSharp.Core.optdata and FSharp.Core.sigdata as part of your application.
6764
6865
69-
If you do _not_ explicitly reference an ``FSharp.Core.dll`` from an SDK location, then an implicit reference will be made
66+
If you do _not_ explicitly reference an FSharp.Core.dll from an SDK location, then an implicit reference will be made
7067
to whichever FSharp.Core.dll your tool is running. This means your tool will almost certainly implicitly reference the FSharp.Core.dll
71-
that is part of your application. In this case, you may either get an error that ``FSharp.Core.optdata`` and ``FSharp.Core.sigdata`` are not
72-
found alongside FSharp.Core.dll. If you want to implicitly reference the ``FSharp.Core.dll`` you are including in your application,
73-
then also add ``FSharp.Core.sigdata`` and ``FSharp.Core.optdata`` as two additional files to your application. When using CompileToDynamicAssembly, this problem
68+
that is part of your application. In this case, you may either get an error that FSharp.Core.optdata and FSharp.Core.sigdata are not
69+
found alongside FSharp.Core.dll. If you want to implicitly reference the FSharp.Core.dll you are including in your application,
70+
then also add FSharp.Core.sigdata and FSharp.Core.optdata as two additional files to your application. When using CompileToDynamicAssembly, this problem
7471
can also manifest itself as [a stack overflow during assembly resolution](https://github.com/fsharp/FSharp.Compiler.Service/issues/258).
7572
76-
Tools that dynamically compile and execute code (e.g. a ``HostedExecution.exe``) normally make an implicit reference to FSharp.Core.dll.
73+
Tools that dynamically compile and execute code (e.g. a ``HostedExecution.exe``) often make an implicit
74+
reference to FSharp.Core.dll, which means they normally also include FSharp.Core.optdata and FSharp.Core.sigdata.
7775
7876
Summary
7977
-------

0 commit comments

Comments
 (0)