在运行时添加新引用... [英] Adding New References at Runtime...

查看:83
本文介绍了在运行时添加新引用...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我的应用程序需要在运行时加载一些dll',有没有办法做到这一点?

你能告诉我吗?非常感谢

Hello,

My application needs load some dll''s at runtime, Is there any way to do it?,
can you show me a working example code?

Many thanks

推荐答案

" Juande" < a@b.com> schrieb:
"Juande" <a@b.com> schrieb:
我的应用程序需要在运行时加载一些dll',有没有办法呢?
My application needs load some dll''s at runtime, Is there any way to do
it?




看看''System.Reflection.Assembly.Load *''的文档。


-

MS Herfried K. Wagner
MVP< URL:http://dotnet.mvps.org/>

VB< URL:http://classicvb.org/petition/>



Take a look at the documentation for ''System.Reflection.Assembly.Load*''.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


好的,谢谢,


现在还有其他问题,我有下一个代码;


Dim Form1 As Form

Form1 =

System.Reflection.Assembly.LoadFrom(" MyDLL.dll")。C reateInstance(" MyDLL.Form2" ;)

Form1.Show()


如何检查是否仍然加载任何dll?


非常感谢


" Herfried K. Wagner [MVP]" <喜*************** @ gmx.at> escribióenel mensaje

news:Od ************** @ TK2MSFTNGP14.phx.gbl ...
Ok thanks,

Now other question please, I have the next code;

Dim Form1 As Form
Form1 =
System.Reflection.Assembly.LoadFrom("MyDLL.dll").C reateInstance("MyDLL.Form2")
Form1.Show()

How can I check if any dll is still loaded?

Many thanks

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> escribió en el mensaje
news:Od**************@TK2MSFTNGP14.phx.gbl...
" Juande" < a@b.com> schrieb:
"Juande" <a@b.com> schrieb:
我的应用程序需要在运行时加载一些dll',有什么办法吗?
My application needs load some dll''s at runtime, Is there any way to do
it?



看一看''System.Reflection.Assembly.Load *''的文档。

MS Herfried K. Wagner
MVP< URL:http:// dotnet。 mvps.org/>
VB< URL:http://classicvb.org/petition/>



Take a look at the documentation for ''System.Reflection.Assembly.Load*''.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>



" Juande" < a@b.com> schrieb:
"Juande" <a@b.com> schrieb:
Dim Form1 As Form
Form1 =
System.Reflection.Assembly.LoadFrom(" MyDLL.dll")。C reateInstance(" MyDLL.Form2")
Form1.Show()

如何查看是否仍然加载了dll?
Dim Form1 As Form
Form1 =
System.Reflection.Assembly.LoadFrom("MyDLL.dll").C reateInstance("MyDLL.Form2")
Form1.Show()

How can I check if any dll is still loaded?




DLL将一直保持加载状态加载DLL的appdomain和/或从$ DLL获得的类型信息将被释放。如果你想卸载一个DLL,你将需要使用辅助appdomain和远程

接口:


< URL:http://www.west-wind.com/presentations/DynamicCode/DynamicCode.htm>

- > 了解.Net如何加载代码


-

MS Herfried K. Wagner

MVP< URL:http ://dotnet.mvps.org/>

VB< URL:http://classicvb.org/petition/>



The DLL will remain loaded until the appdomain that loaded the DLL and/or
obtained type information from the DLL will be released. If you want to
unload a DLL, you''ll have to work with a secondary appdomain and remote
interfaces:

<URL:http://www.west-wind.com/presentations/DynamicCode/DynamicCode.htm>
-> "Understanding how .Net loads code"

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


这篇关于在运行时添加新引用...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆