General C#/Development Question (1 Viewer)

whiskaz

Portal Member
February 1, 2008
39
1
I'm working on a small app that uses a couple of MediaPortal libraries (Databases.dll, which in turn uses other MediaPortal dlls). I'm having trouble running it (an executable) outside of the VS project folder. I'm a Java developer by day and new to the world of DLLs, etc.

I was really hoping to be able to use the DLLs that are already in the MediaPortal installation folder and not have to make copies - is there a way to do this? In the meantime, I've copied everything out of the VS2008/project/bin/Debug folder (exe w/ MediaPortal dlls) and I get an error when it tries to call one of the MP dlls. It's actually showing a different assembly version for the dll it's looking for than the one that was built in the Debug folder.

Again, the exe runs fine when I run it from the Debug folder but not when I move everything to another location.

Code:
Unhandled Exception: System.BadImageFormatException: Could not load file or asse
mbly 'Databases, Version=1.0.0.29792, Culture=neutral, PublicKeyToken=null' or o
ne of its dependencies. An attempt was made to load a program with an incorrect
format.
File name: 'Databases, Version=1.0.0.29792, Culture=neutral, PublicKeyToken=null

The DLL it was built against was version shows as 1.0.0.29792 in VS but the dll in the debug folder shows 1.0.0.21149.

I'd prefer if there was a way to use the existing installed DLLs (I added those as references in the project and it appears to have copied those versions to the Debug folder).

Any help would be much appreciated!!

Thanks,
Jeremy
 

whiskaz

Portal Member
February 1, 2008
39
1
Figured it out. I was coding on a 32-bit OS w/ Any CPU set on the build then running on an x64 system.
 

Users who are viewing this thread

Top Bottom