Click here to Skip to main content
15,916,378 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
so I have some 3rd party dlls which are called by a c++ dll for which I wrote a wrapper in CLI(compiled with /clr) and I am calling funtions and methodes in my c# app.
If I do it in the debug everything works perfectly. But when I switch to release and compile everything ok(even using the 3rd party release dll's) it keeps telling me that the wrapper dll was not found.
error :
C#
//Could not load file or assembly 'xxx, Version=1.0.4475.16087, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

why could that be possible...and I searched the path and the dll exists there.
By the way all my dlls and executable are all built in the same directory.

and one more thing...is it possible to have relative paths everywhere so I can make it more portable ?
Posted

1 solution

So it works if I change in the c# project from Any CPU to x86(all dlls are compiled in WIN32) from Properties -> Build -> Platform Target. I work on a 64-bit Win7 pc and aparently if I use Any CPU as target it does't find the wrapper dll.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900