Ah nice, bit of lateral thinking there. I added them as Linked files so that the actual dll could remain where it is (and if it's updated it will automatically pick up the change)
Many thanks, I think that's a little cleaner than the post build script. more visible too. cheers, Stephen On Tue, Aug 3, 2010 at 11:36 AM, Michael O'Dea-Jones <[email protected]> wrote: > Hi Stephen, > > Ah, I see. Try this. Add the unreferenced DLL's to your project, but not as > references, much like you would add a jpg or gif file. Then click the file > and press F4 to bring up the files properties. Set the Copy to Output > Directory to "Copy always" or "Copy if Newer". That way the files will be > copied to the bin folder. > > Regards, > Michael O'Dea-Jones > > -----Original Message----- > From: [email protected] [mailto:[email protected]] On > Behalf Of Stephen Price > Sent: Tuesday, 3 August 2010 1:13 PM > To: ozDotNet > Subject: Re: Native code references > > Hi Michael, > > I'm doing that part, but the dependencies of the dll's being referenced are > not copied. It won't let me add the native code dll's as a reference, it > gives an error telling me to check the file is accessible, that it is a valid > assembly or COM component. > > I used depends.exe (Dependency Walker) to figure out what dll's it was > looking for in the third party dlls. ie the c# wrapper dll is called > hoops1811_cs90.dll (which I can add as a reference) but the > hoops1811_vc90.dll file won't add (but manually copying or copying via Post > build) gets the unit test running. > > I've got it all copying and running (and passing!) now so I was just > wondering if that's the normal thing to do (using Post build to copy > dependencies) > > thanks for the reply, > Stephen > > On Tue, Aug 3, 2010 at 9:41 AM, Michael O'Dea-Jones <[email protected]> > wrote: >> Hi Stephen, >> >> I am working on a C# project using VS2008 and have COM objects. I have added >> the DLL's as references and they are being copied to the Unit Test project. >> If you slick the DLL under references and press F4 you will see the >> references properties. For my DLL's Copy Local is set to True. I hope this >> helps. >> >> Regards, >> Michael O'Dea-Jones >> >> -----Original Message----- >> From: [email protected] >> [mailto:[email protected]] On Behalf Of Stephen Price >> Sent: Tuesday, 3 August 2010 11:36 AM >> To: ozDotNet >> Subject: Native code references >> >> hey all, >> >> I find myself delving into the world of COM and Native code (ie C++) and >> calling it from managed code. Something I've been tripped up by is missing >> dll's. I was wondering if there's an easy way I've missed that someone could >> share. >> >> I'm writing some unit tests for code that wraps calls to these native dll's >> but I've found adding references to the supplied C# wrapper classes does not >> automagically copy the required dll's along with it. >> I've had to resort to Post build copies of the required native dll's and >> their dependencies, which once I've done works fine. >> >> Is that the best practice, or have i missed something? I've managed to >> avoid this until now (and to be honest am having fun with it. I feel >> like a REAL programmer. lol) >> >> cheers, >> Stephen >> >
