Home All Groups Group Topic Archive Search About

Refernece an assembly using a string

Author
23 Jan 2006 6:14 PM
D Witherspoon
I'd like to reference a compiled .NET dll assembly using a string in my
application.

In VB 6.0 this could be done similariliy using CreateObject(sString) instead
of referencing the object type in your application.

There must be something similar you could do in VB.NET so that the reference
does not have to be included in the project.

Any help?

Author
23 Jan 2006 6:27 PM
Armin Zingler
"D Witherspoon" <dwithersp***@noway.org> schrieb
> I'd like to reference a compiled .NET dll assembly using a string in
> my application.
>
> In VB 6.0 this could be done similariliy using CreateObject(sString)
> instead of referencing the object type in your application.
>
> There must be something similar you could do in VB.NET so that the
> reference does not have to be included in the project.


http://msdn.microsoft.com/library/en-us/cpguide/html/cpcondiscoveringtypeinformationatruntime.asp


Armin
Author
23 Jan 2006 6:55 PM
Herfried K. Wagner [MVP]
"D Witherspoon" <dwithersp***@noway.org> schrieb:
> I'd like to reference a compiled .NET dll assembly using a string in my
> application.

'Assembly.LoadFrom', 'Activator.CreateInstance'.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
23 Jan 2006 7:04 PM
Cor Ligthert [MVP]
D,

You can create a library as DLL.

You can than using Project, Add Reference add that DLL to your project.

By importing the namespace it or fully qualify the name, can you use the
classes from that DLL in your application as objects.

I hope this helps,

Cor