I'm trying to compile an F# program that wants to use arbitrary precision rational numbers. The source code contains
open MathNet.Numerics
and MathNet.Numerics and MathNet.Numerics.FSharp are installed in such a way that Visual Studio is happy. Now I'm trying to compile the program from the command line using fsc directly (in order to have more control over what's going on). Clearly, the compiler needs to be told about the referenced assembly.
I've tried
fsc -r:MathNet.Numerics ...
but it says
error FS0082: Could not resolve this reference. Could not locate the assembly "MathNet.Numerics". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. (Code=MSB3245)
Presumably I need to use some other option that tells fsc where to look for the assembly in question. Which option should I use, and what location should I supply? (There are quite a few copies of various versions of MathNet.Numerics.dll on the machine; it's not clear which should be regarded as canonical for this purpose.)
CodePudding user response:
You can specify the full path to the assembly with -r
, not just the file name. For me, it looks like this:
-r:C:\Users\MyName\.nuget\packages\mathnet.numerics\4.15.0\lib\netstandard2.0\MathNet.Numerics.dll
Alternatively, you can use -I:folder-name
to specify a directory to be searched for assemblies that are referenced.
These compiler options are documented here.