pre-release Collections.Immutable

我怕爱的太早我们不能终老 提交于 2019-11-30 01:47:10

问题


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


回答1:


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.




回答2:


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/



来源:https://stackoverflow.com/questions/14017219/pre-release-collections-immutable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!