Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assembly in asp.net

Tags:

c#

.net

asp.net

I'm having one assembly.I need to use that assembly in my application.i dont want to give reference to that assembly and not GAC also.

How to use that assembly in my application?

like image 309
sonal Avatar asked Aug 02 '26 05:08

sonal


2 Answers

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

like image 106
Pranay Rana Avatar answered Aug 03 '26 17:08

Pranay Rana


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

like image 22
Jagmag Avatar answered Aug 03 '26 17:08

Jagmag



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!