FSC编译警告:程序集"SMDiagnostics"被过度引用,无法自动解决程序集

Hen*_*k K 4 compiler-construction f# compiler-warnings fsc

在编译我的项目时(它是一个实现Windows服务的控制台应用程序),间歇性地发布了上述警告.

(这里有完整的警告文字)

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)
Run Code Online (Sandbox Code Playgroud)

这个错误意味着什么,可能导致什么?

Bri*_*ian 5

我不是百分百肯定,这是我的猜测.

您正在使用System.ServiceModel,并将其添加为项目中的参考.反过来,ServiceModel使用SMDiagnostics程序集,但您没有在项目中显式引用它.您可能正在编译--standalone,因此它警告您无法找到所有程序集的传递闭包?

无论如何,我希望如果你添加一个明确的SMDiagnostics引用,警告就会消失.无论如何,这可能是一个无害的警告(我认为SMDiagnostics可能在GAC中,因此无论如何都会在运行时发现).