预发布 Collections.Immutable [英] pre-release Collections.Immutable
问题描述
有没有人在 F# 中从 NuGet 成功打开预发布的System.Collections.Immutable
?
Has anyone succeeded in opening the pre-release System.Collections.Immutable
from NuGet in F#?
我收到此错误:
此处需要类型IEnumerable`1"且不可用.您必须添加对程序集System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"的引用.
The type 'IEnumerable`1' is required here and is unavailable. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
即使我的项目是 .NET 4.5
Even though my project is .NET 4.5
尝试显式打开 System.Runtime,但也没有用.我正在引用 .NETCorev4.5System.Runtime.dll
Tried explicitly opening System.Runtime and that did not work either. I am referencing .NETCorev4.5System.Runtime.dll
推荐答案
这是 Microsoft 相关团队正在调查的已知问题.同时,以下是解决方法步骤:
This is a known issue that the relevant teams at Microsoft are investigating. In the meantime, here are the workaround steps:
- 创建一个面向 .NET Framework 4.5 的 F# 应用程序项目
Install-Package Microsoft.Bcl.Immutable -pre
- 添加对%ProgramFiles%Reference AssembliesMicrosoftFramework.NETFrameworkv4.5FacadesSystem.Runtime.dll"的引用
- 从框架中添加对 System.ComponenModel.Composition.dll 程序集的引用.
在那之后,早期测试表明 F# 可以很好地处理不可变集合.
After that, early testing suggests F# works with the immutable collections just fine.
这篇关于预发布 Collections.Immutable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!