J
jmagaram
i've been tearing my hair out over this for hours. i can reference a C++
library from my C# code on my dev machine, but when i copy the entire Debug
directory to another computer my code fails, giving a "Could not load file or
assembly <nameofC++library>...the application configuration is incorrect."
To repro, I first create a C++ CLR class library and add one class with a
simple function "int GetAge()" that returns the number 20. I then create a
Windows app with a form and a button on it that calls GetAge() and displays
the result in a message box. To reference the C++ library, I click on
References, Add Reference, Projects, and then the name of my C++ class
library project. The code works fine - debug and release - on my dev machine.
I copy the Debug (or Release) directory to an XP machine and run it; the form
pops up but as soon as I click the button (which calls into the C++ library)
it croaks. This is VS 2005, .net 2.0.
What am I doing wrong? My scenario couldn't be a simpler example of C++ and
C# playing nice together.
library from my C# code on my dev machine, but when i copy the entire Debug
directory to another computer my code fails, giving a "Could not load file or
assembly <nameofC++library>...the application configuration is incorrect."
To repro, I first create a C++ CLR class library and add one class with a
simple function "int GetAge()" that returns the number 20. I then create a
Windows app with a form and a button on it that calls GetAge() and displays
the result in a message box. To reference the C++ library, I click on
References, Add Reference, Projects, and then the name of my C++ class
library project. The code works fine - debug and release - on my dev machine.
I copy the Debug (or Release) directory to an XP machine and run it; the form
pops up but as soon as I click the button (which calls into the C++ library)
it croaks. This is VS 2005, .net 2.0.
What am I doing wrong? My scenario couldn't be a simpler example of C++ and
C# playing nice together.