Reputation: 165
I wrote a simple dll using C++. When I import it in a c# .NetStandard project, it works correctly. But when I import it in c# .NetCore project it throws an exception System.BadImageFormatException: An attempt was made to load a program with an incorrect format.
Dll import code for both .NetCore and .NetStandard are same
const string dllLocation = "StringLibrary";
[DllImport(dllLocation, CallingConvention = CallingConvention.Cdecl)]
private static extern void splitstring();
How do I resolve it?
Upvotes: 0
Views: 286