pre释放Collections.Immutablepre、Collections、Immutable

2023-09-03 02:26:27 作者:冷瞳°

有没有人成功地打开了pre-发布 System.Collections.Immutable 从的NuGet在F#?

Has anyone succeeded in opening the pre-release System.Collections.Immutable from NuGet in F#?

我得到这个错误:

类型IEnumerable`1这里需要和不可用。您必须添加一个引用程序集System.Runtime,版本= 4.0.0.0,文化=中性公钥= 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,并没有擦出火花。我引用 .NETCore \ V4.5 \ System.Runtime.dll

Tried explicitly opening System.Runtime and that did not work either. I am referencing .NETCore\v4.5\System.Runtime.dll

推荐答案

这是一个已知的问题,相关团队在微软正在调查。在此期间,这里的解决方法步骤:

This is a known issue that the relevant teams at Microsoft are investigating. In the meantime, here are the workaround steps:

创建一个F#应用程序项目面向.NET框架4.5 安装-包Microsoft.Bcl.Immutable - pre 添加引用为%ProgramFiles%\参考大会\微软\ Framework.NETFramework \ V4.5 \外立面\ System.Runtime.dll 添加引用,从框架的System.ComponenModel.Composition.dll组装。 Create an F# Application project that targets .NET Framework 4.5 Install-Package Microsoft.Bcl.Immutable -pre Add a reference to "%ProgramFiles%\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\Facades\System.Runtime.dll" Add a reference to the System.ComponenModel.Composition.dll assembly from the Framework.

在此之后,早期的测试表明,F#工程与不变集合就好了。

After that, early testing suggests F# works with the immutable collections just fine.