Right after I moved from XP to Vista,I realized my C# programs don't work.
This is the situation: I wrote a C++ dll that I use in my C# application.The DLL worked fine in XP,but when I moved to Vista it's not longer working in C#.
I tested it in Delphi,works fine,but C# - no.
I wrote additional code to make my check easier in C#.
if (LoadLibrary("blowfish.dll") == 0)
{
Misc.LogToFile("error", true);
Application.Exit();
}
It doesn't need C++ runtime,because Its compiled with the libraries and it works in Delphi on Vista,but not C#.
Where could the problem be?
Thanks in advance.
On x64 platform the JIT will compile your program into x64, since your native C++ is compiled to x86 it will fail to load it.
You need to explicitly tell the JIT to compile your program to x86, you can do it using CorFlags or the project settings set the CPU type to x86 (Under Build/Platform target)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With