Using local dll - references

V

verukins

Hi all,
i'd like to add a reference i a vb.net program to a dll i
know is located in C:\windows\system32 - and that i can safely assume
will be on every system this program will be run on.

At the moment, when i add this dll as a reference (in the project
properties), a copy of the dll is made, and i need to copy it around
with my program in order for it to work.

How do i get my program just to use the one that i know will be on
everyones system ?

Im using VS 2008 - and am a bit of a newbie at this - so idiot level
instructions would be appreciated.
 
M

Michel Posseth [MCP]

You are probably talking about a COM dll , you can then safely remove it
from your deploy package
as COM in .Net will check app.path ( or alternate location in the
app.config ) , system32 and GAC before it blows up

HTH

Michel
 
V

verukins

yes, the one for this instance is a com dll, and if i dont copy it
around with the program, it blows up straight away
so thanks for your reply, but im still not sure how to handle it ?

Im trying to use C:\windows\system32\wuapi.dll, so it is available in
a default path... but the program still seems to want to copy it
everywhere.
 
A

Armin Zingler

yes, the one for this instance is a com dll, and if i dont copy it
around with the program, it blows up straight away
so thanks for your reply, but im still not sure how to handle it ?

Im trying to use C:\windows\system32\wuapi.dll, so it is available in
a default path... but the program still seems to want to copy it
everywhere.

On the target machine, you must have the interop library
(Interop.WUApiLib.dll) in your application folder and it must be registered
(regasm).


Armin
 
V

verukins

ok, so does that mean there is no way to have this application run
with just the exe ?

It just seems a bit whacky to me that the required dll is on the
target machines - but i still need additional stuff (the interop)

so i just want to confirm that there is no way around this... ?

The next logical question is, can i use code to create and register
the interop on each machine where it is run as needed using the dll
already on the local machine ?

Thanks.
 
A

Armin Zingler

ok, so does that mean there is no way to have this application run
with just the exe ?

It just seems a bit whacky to me that the required dll is on the
target machines - but i still need additional stuff (the interop)

so i just want to confirm that there is no way around this... ?

There is no way around. You have two different worlds, managed and COM, and
without a translator, the interop dll, it can not work. Maybe there are
hacks that I don't know of.
The next logical question is, can i use code to create and register
the interop on each machine where it is run as needed using the dll
already on the local machine ?

I don't know how to deploy it. Manually I'd run Regasm.exe. The dll on the
local machine will be used.
You'll probably find all your answers about deployment in the MSDN library,
as usual.


Armin
 
V

verukins

ok - im surprised... no, exteremly surprised that this is the case...
but ok.

thanks for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top