Setting the --lib suppresses the FS2011 warning. It effectively tells fsc.exe where to search for the two DLL files so it can link them in at build time. We like the static build option because it enables our goal of being able to unzip our software to a new windows box and have it run with no other configuration required.
set FSLIB=--lib:c:\Windows\Microsoft.NET\Framework\v4.0.30319
set compileFlags=--debug:full --standalone --optimize+ --crossoptimize+ --tailcalls+ %FSLIB%
fsc %compileFlags% MyFSharpProgram.fsx
In lieu of the environment variables you can simply add the following to your compile command. --lib:c:\Windows\Microsoft.NET\Framework\v4.0.30319
You will need to substitute the whatever directory contains the necessary DLL for the one we used. I used the cygwin find command ran as administrator to find locate the directory.
find . | grep SMDiagnostics
Resolved the following warnings from F# (FSC.EXE) compiler
warning FS2011: Assembly 'System.ServiceModel.Internals' was referenced transitively and the assembly could not be resolved automatically. Static linking will assume this DLL has no dependencies on the F# library or other statically linkedDLLs. Consider adding an explicit reference to this DLL.
warning FS2011: Assembly 'SMDiagnostics' was referenced transitively and the assembly could not be resolved automatically. Static linking will assume this DLL has no dependencies on the F# library or other statically linked DLLs. Consider adding an explicit reference to this DLL.
Joe E