处置导入的D​​LL

编程入门 行业动态 更新时间:2024-10-15 00:26:22
本文介绍了处置导入的D​​LL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在我的代码中,我使用DllImport("OTVPlayer.dll")]及其方法导入DLL.使用后如何处置此DLL?请帮忙.非常紧急的

In my code im importing a DLL using DllImport("OTVPlayer.dll")] and using its methods. How can I dispose this DLL after using? Please help. very urgent

推荐答案

在.NET中,除非卸载所有AppDomain,否则无法卸载模块/组件.卸载程序集时应释放不受管的库. 尝试创建一个新的AppDomain,完成您的工作,并在完成后将其卸载.我知道这不好. In .NET you cannot unload modules/assemblies unless you unload all AppDomain. The unamanaged libraries should be released when calling assembly is unloaded. Try to create a new AppDomain, do your stuff and when you finish, unload it. It''s not nice, I know.

更多推荐

处置导入的D​​LL

本文发布于:2023-11-28 12:30:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1642405.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!