pre-release Collections.Immutable

2019-02-12 04:46发布

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

I'm getting this error:

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'.

Even though my project is .NET 4.5

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

2条回答
唯我独甜
2楼-- · 2019-02-12 04:57

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

  1. Create an F# Application project that targets .NET Framework 4.5
  2. Install-Package Microsoft.Bcl.Immutable -pre
  3. Add a reference to "%ProgramFiles%\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\Facades\System.Runtime.dll"
  4. Add a reference to the System.ComponenModel.Composition.dll assembly from the Framework.

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

查看更多
叛逆
3楼-- · 2019-02-12 05:18

You can installed "System.Collections.Immutable" component from NuGet that will resolved your problem.

Have a look to the URL https://www.nuget.org/packages/Microsoft.Bcl.Immutable/

查看更多
登录 后发表回答