我试图添加对System.Memory的引用
#r "C:/Program Files/dotnet/shared/Microsoft.NETCore.App/2.1.5/System.Memory.dll"但是F#互动仍然说The value or constructor 'Span' is not defined。当我尝试使用open System.Memory时,它说是The namespace 'Memory' is not defined。有办法这样做吗?
发布于 2018-10-31 00:34:59
您不需要open System.Memory,但是您需要open System。您还可能希望先将nuget System.Memory放入.NET框架应用程序中,然后引用它。我想知道FSI将如何与Span<T>交互。
#if INTERACTIVE
#r @"C:\Users\username\Documents\Source\ConsoleApplication1\packages\System.Memory.4.5.1\lib\netstandard2.0\System.Memory.dll"
#r "System.Runtime.dll"
#endif
open System
open System.Runtime.CompilerServices
[<IsByRefLike; Struct>]
type S(count1: Span<int>, count2: Span<int>) =
member x.Count1 = count1
member x.Count2 = count2 https://stackoverflow.com/questions/53070089
复制相似问题