Referencing external DLL? VS2005 copies to bin directory

C

Chris Ashley

I've written a C++ Wrapper DLL which I need to add a reference to in my
ASP.Net project. This in turn is dependent on the DLL it wraps which is
in turn dependent on some other DLLs. When I reference the wrapper DLL
VS2005 copies it to the 'bin' directory and I am unable to compile with
the error 'the specified module could not be found'. It still has the
same behaviour if I copy all the dependent DLLs to my bin directory,
but this isn't a solution anyway because I need to maintain the
directory structure and DLL locations on this machine (for source
control reasons) and I don't want Visual Studio moving things around.

I know my DLL is okay because I developed a quick tester windows app
which referenced the DLL without 'copy local' - this worked fine.

How can I fix this?
 
B

bruce barker \(sqlwork.com\)

your bin folder is not the working dir of the app, so the default loading
does not find it. you can copy the dll to windows\system32, to the .net
framework bin, or change the working folder to a directory containing the
dll before referencing the first time.

note: the web site does not really use the bin folder, it is shadow copied
to another dir in temp so the dlls will not be in use, and thus can be
updated with new dll's

-- bruce (sqlwork.com)
 
C

Chris Ashley

Hi Bruce,

Thanks for that. How do I change the working folder for an ASPNet site
in VS2005?

Thanks,

Chris
 

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