I've been using Linux for years and because of the habit, I added / (slash) instead of \ (backslash) for path to my c# code.
private const string X86DllPath = "x86/ShaferFilechck.dll"; // should use x86\\ShaferFilechck.dll
private const string X64DllPath = "x64/ShaferFilechck.dll";
[DllImport(X64DllPath, EntryPoint = "NalpLibOpen", CallingConvention = CallingConvention.Cdecl)]
private static extern int NalpLibOpen_64(byte[] xmlParms);
The code works, but I'm wondering if c# translates slash to backslash when compiled and run on Windows. Is there some official documentation stating this or something.
Could using / in path result in some unexpected behaviour under some circumstances.
Update:
I know the ultimate solution would be to use this, but I'm wondering why slash is still 'ok':
Path.Combine("x86", "ShaferFilechck.dll"); // x86\ShaferFilechck.dll