compiler-constructionf#compiler-warningsfsc

FSC compilation warning: Assembly 'SMDiagnostics' was referenced transitively and the assembly could not be resolved automatically


Intermittently when compiling my project (it is a Console Application implementing a Windows Service) the above warning is posted.

(here full warning text)

Warning 1   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.   
FSC 1   1   myService (Applications\myService\myService)

What does this error mean and what could be causing it?


Solution

  • I am not 100% sure, here is my guess.

    You are using System.ServiceModel, and have it added as a reference in your project. ServiceModel, in turn, uses the SMDiagnostics assembly, but you don't have that explicitly referenced in your project. You're maybe compiling with --standalone, and so it's warning you about not being able to find the transitive closure of all the assemblies?

    Anyway, I expect that if you add an explicit reference to SMDiagnostics, the warning will go away. It's probably a harmless warning anyway (I think SMDiagnostics is probably in the GAC so it will be found at runtime regardless).