G
Guest
Hello,
Let me explain my situation. There is an application in C++ (that I didn't
write) that needs to call a C# DLL. One option, I believe, would be to
compile the app with the clr switch. Rather than do that first the other
developer wondered if I could create an intermediate managed code DLL that
would call my C# code.
So, I created a C++ DLL that exports a function and compiled it with the clr
switch. It calls my C# code. To test I created a C++ console application that
uses LoadLibrary to load the C++ managed code DLL. I originally had the C++
and the C# DLLs in the same directory and the executable in a different
directory. With that set up I always get a FileNotFoundException error. It
says it can't find the C# assembly. When I move the executable to the same
directory as the two DLLs it works fine.
Does anyone have any ideas as to why it would behave that way? Thanks for
any help, I really appreciate it.
Thanks,
Nick
Let me explain my situation. There is an application in C++ (that I didn't
write) that needs to call a C# DLL. One option, I believe, would be to
compile the app with the clr switch. Rather than do that first the other
developer wondered if I could create an intermediate managed code DLL that
would call my C# code.
So, I created a C++ DLL that exports a function and compiled it with the clr
switch. It calls my C# code. To test I created a C++ console application that
uses LoadLibrary to load the C++ managed code DLL. I originally had the C++
and the C# DLLs in the same directory and the executable in a different
directory. With that set up I always get a FileNotFoundException error. It
says it can't find the C# assembly. When I move the executable to the same
directory as the two DLLs it works fine.
Does anyone have any ideas as to why it would behave that way? Thanks for
any help, I really appreciate it.
Thanks,
Nick