M
Mr. X.
Hello.
How can I use dll dynamically in my code?
Thanks![Smile :) :)](/styles/default/custom/smilies/smile.gif)
How can I use dll dynamically in my code?
Thanks
![Smile :) :)](/styles/default/custom/smilies/smile.gif)
That's a pretty broad question. Depending upon what is needed, theHello.
How can I use dll dynamically in my code?
How can I use dll dynamically in my code?
Assuming that by "dynamically" you mean that you don't want to link your
own assembly to the DLL assembly you want to use (i.e. use a DLL not
known at compile time), then the basic approach involves reflection.
There is a new plug-in framework with .NET 4.0 that is supposed to make
this easier. If you can restrict your goal to something where that is
usable, then that would probably be a better approach.
Otherwise, you're
going to have to load the assembly explicitly, inspect it for relevant
types, and execute the code within all via reflection.
I meant :
I.e I want to load "System.Data.SqlClient dll" on runtime, and use some
of it's classes (such as SqlConnectionStringBuilder)
What I did for the sample you gave,
for MySql, I got the message :
=========================
Could not load file or assembly 'MySql.Data.MySqlClient' or one of its
dependencies. The system cannot find the file specified.