Following this https://learn.microsoft.com/en-us/information-protection/develop/setup-configure-mip I have created Console App, add code. After running getting below error: LoadLibrary failed for: [sdk_wrapper_dotnet.dll] at MIP.Initialize(MipComponent.File);
Please let me know what am I missing.
Thanks, Raj
`
//Step 1:
internal static class UnsafeKernel32NativeMethods
{
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode,
CallingConvention = CallingConvention.StdCall)]
internal static extern bool SetDllDirectory([In] [MarshalAs(UnmanagedType.LPWStr)] string lpPathName);
}
//Step 2: Set path to bins folder
var path = Path.Combine( Directory.GetParent(Path.GetDirectoryName(new Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath)).FullName, Environment.Is64BitProcess ? "binsx64" : "binsx86");
//Step 3: Use custom UnsafeKernel32NativeMethods class to configure managed to unmanaged marshalling.
Utilities.UnsafeKernel32NativeMethods.SetDllDirectory(path);
//After doing above Steps below code is working in Web Application MIP.Initialize(MipComponent.File);
`