.net – 我可以在MonoLinux上使用Visual Studio附带的FSharp.Core

.net – 我可以在MonoLinux上使用Visual Studio附带的FSharp.Core,第1张

概述因为我感到困惑,我会感激一些帮助. 如果我相信这个page,使用我的应用程序部署FSharp核心的最佳方法是将FSharp.Core.dll与app二进制文件一起复制(“xcopy部署”). In compiled applications, you should never assume that FSharp.Core is in the GAC (“Global Assembly Cache 因为我感到困惑,我会感激一些帮助.

如果我相信这个page,使用我的应用程序部署FSharp核心的最佳方法是将FSharp.Core.dll与app二进制文件一起复制(“xcopy部署”).

In compiled applications,you should never assume that FSharp.Core is in the GAC (“Global Assembly Cache”). Instead,you should deploy the appropriate FSharp.Core as part of your application.

到目前为止一切都很好,我对windows感到非常满意……但是,关于Mono,同一页面上写着:

Standard installations of F# tools on linux and Mac on Mono also install the latest FSharp.Core into the GAC. They also add machine-wIDe binding redirects for that component. That means that,for those machines,the latest installed FSharp.Core will be used by applications

哪种提示不应该使用应用程序部署FSharp核心副本,并且将从Mono GAC中获取正确版本的FSharp核心.我对此有两个问题:

>这迫使windows和linux有两种不同的部署方案;
>在Mono上,这可能会强制使用较旧的FSharp代码而不是最新的Visual Studio中可用的代码.

这两个问题都可能通过始终从GitHub源和应用程序构建FSharp核心来解决,但这看起来也不是一个优雅的解决方案.所以我想知道无论平台如何,总是使用最新FSharp核心的正确方法是什么(如果可能的话)?

解决方法 我的理解是,如果将FSharp.Core与应用程序包含在任何平台上,至少对于Framework Dependent Deployments,则在查找GAC之前首先探测并使用本地bin目录.这里可能还有很多其他的细微之处,但至少从我的理解来看,你的本地复制版本的FSharp.Core将是你的应用程序使用的版本.

顺便说一句,通过使用一些反射来查看源自FSharp.Core的加载类型并查看它来自哪个程序集,应该相对容易进行测试.此外,我可以回想起AppDomain.AssemblyResolve或类似的事件可能会让你更深入地了解解决过程,甚至可以稍微定制它.

值得一提的是,就GAC而言,这个故事可能会在.NET Core上发生很大的变化,同时还有我上面提到的反射相关技术的可用性.

有关:

> Dll in both the bin and the gac,which one gets used?
> Is there any GAC equivalent for .NET Core?

总结

以上是内存溢出为你收集整理的.net – 我可以在Mono / Linux上使用Visual Studio附带的FSharp.Core全部内容,希望文章能够帮你解决.net – 我可以在Mono / Linux上使用Visual Studio附带的FSharp.Core所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/1029283.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存