From the FAQ:
dllnotfound exceptions
If you get dllnotfound exceptions, then that means that you didn't copy over the newly made dlls in steps 6 and 7.
This is a general error which means that a dll that's used by the executable hasn't been found. It does not necessarily mean that the dll which is directly referenced is the problem. Typically, if you didn't copy over the gdcm.dll and associated libraries, but have set gdcmsharpglue.dll as one of your program references, you'll get this error. It doesn't mean that gdcmsharpglue is missing, it means that an underlying library is missing.
For finding out which dll is missing, try using Dependency Walker. This program will find the missing library, and then you can put it in the path of the executable.
One way around this problem is to set up an 'includes' directory in your application tree (assuming you're in Windows, not Mono-- Mono may be different) which contains the gdcm libraries. From there, you can make a post-build event for your project, so files get copied when you do a build. This approach takes some time each time you do a build, but saves time when you are trying to figure out where your libraries are and why you're getting dll not found exceptions.
- open your solution
- right click on your project
- select 'build events' (third tab down from the top)
- put some dos commands in the 'post-build event command line' box. I have
mkdir Debug
mkdir Release
copy ..\..\..\Includes\gdcm\*.dll ..\Debug\*.dll
copy ..\..\..\Includes\gdcm\*.dll ..\Release\*.dll
The two mkdir's in there so that if you're rebuilding from scratch, you don't get an error on build. That is, if you're building debug and you don't have a release directory, the copy lines give you an error. If you don't copy to both directories, when you go to build your release build after working in debug all this time, your release build won't work and you'll be really frustrated when you figure out you forgot to copy the dll's to both release and debug.