简体   繁体   English

如何动态加载和卸载F#dll到C#项目?

[英]How to dynamically load and unload an F# dll into an C# project?

I understand how to load an F# dll into a project. 我理解如何将F#dll加载到项目中。 But I would like to be able to load specific parts of them dynamically and without a big performance hit from the dll being purely functional. 但我希望能够动态加载它们的特定部分,而不会从dll中获得很大的性能。

To unload an application domain 卸载应用程序域

There is no way to unload an individual assembly without unloading all of the application domains that contain it. 如果不卸载包含它的所有应用程序域,就无法卸载单个程序集。 Use the Unload method from AppDomain to unload the application domains. 使用AppDomain中的Unload方法卸载应用程序域。 For more information, see How to: Unload an Application Domain. 有关更多信息,请参见如何:卸载应用程序域。

Taken from https://msdn.microsoft.com/en-us/library/ms173101.aspx 取自https://msdn.microsoft.com/en-us/library/ms173101.aspx

The idea will be to initialize a new application domain for the F# library, then drop it after you're done using it. 我们的想法是为F#库初始化一个新的应用程序域,然后在使用它之后删除它。 I think you're going to have to make sure you compile the F# lib as a Strong-Named assembly and add it to the GAC to accomplish this, but I'm not positive. 我认为你必须确保将F#lib编译为强名称程序集并将其添加到GAC以实现此目的,但我并不积极。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM