但是,在FSharp.Core(v2)中mscorlib.dll(v4)中定义的某些类型被显示为“重复”,如System.Tuple和System.IObservable.我不明白为什么这是在.Net 4. Matt Ellis specifically said they would be removed in his MSDN article:
One language suffering that [duplication] problem was F#,which prevIoUsly had defined its own tuple type in FSharp.Core.dll but will now use the tuple added in Microsoft .NET Framework 4.
但是,如果我可以指定我想在C#程序中使用哪一个,我已经准备好看看这个特别的非常重复的重复.当我尝试使用System.Tuple类型,例如,我得到以下C#编译器错误:
Error 2 The type ‘System.Tuple’ exists in both ‘c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\Profile\Client\mscorlib.dll’ and ‘c:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v2.0\FSharp.Core.dll’
这显然是a switch on the C# compiler command line which aliases the type:
csc.exe MyType.cs /reference:System.Tuple`2=mscorlib.dll /reference:FSharp.Core.dll
但是,我找不到一种方法让Visual Studio将此参数发送到C#编译器.
有人有解决这个问题吗?
解决方法
C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v4.0