开发者

Assembly in asp.net

开发者 https://www.devze.com 2023-01-11 06:24 出处:网络
I\'m having one assembly.I need to use that assembly in my application.i don开发者_如何学编程t want to give reference to that assembly and not GAC also.

I'm having one assembly.I need to use that assembly in my application.i don开发者_如何学编程t want to give reference to that assembly and not GAC also.

How to use that assembly in my application?


Make use of reflection and load assembly dynamically tha you can call the methods of it.

here is one example of it

Assembly assembly = Assembly.LoadFrom("MyNice.dll");

Type type = assembly.GetType("MyType");

object instanceOfMyType = Activator.CreateInstance(type);

Dynamically Loading an assembly at Runtime and calling its methods


One option is to use reflection

You can refer to this link for more details as to possible implementation

http://www.codeproject.com/KB/cs/csharpreflection.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消