We have an on-premise .Net Framework console application that runs as a Windows service which uses the MIP SDK to read and apply labels to files. We are in the process of upgrading to the latest version (1.17.158) from our existing deployed one (1.14.128) and are now seeing an AccessViolationException at the point the MIP context object is created.
Having worked through the different versions of the SDK it appears this issue was introduced in the update from v1.16 to v1.17. We see the issue for all variants of v1.17 but not in the latest 1.16 release (1.16.149).
The error is thrown when we are attempting to create an MIP context object with the following code:
var mipConfiguration = new MipConfiguration(appInfo, "mip_data", LogLevel.Info, false, CacheStorageType.InMemory)
{DiagnosticOverride = diagnosticConfiguration};
_mipContext = Microsoft.InformationProtection.MIP.CreateMipContext(mipConfiguration);
With the appInfo object containing properties that we have seen be successful with previous versions of the SDK.
The Windows Event log captures the following error and stack trace:
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at Microsoft.InformationProtection.Internal.SdkWrapperPINVOKE.MipContext_Create__SWIG_1(System.Runtime.InteropServices.HandleRef)
at Microsoft.InformationProtection.Internal.MipContext.Create(Microsoft.InformationProtection.Internal.MipConfiguration)
at Microsoft.InformationProtection.Utils.MIPHelper.CreateMipContext(Microsoft.InformationProtection.MipConfiguration)
So it appears that the issue occurs when calling into the C++ code to create the MIP Context there.
The release notes for the 1.17.137 indicate an update to the MSCV version, but nothing else appears to relate to C++ changes.
This is occurring in more than one deployment environment, with different Windows OS instances (2016, 2019 and 2022) all exhibiting the same behaviour, with each having .Net 4.8 deployed.
We're wondering if there's anything we've missed in terms of environmental pre-reqs to get this working? It seems like a severe defect that would likely have been caught pre-release if it exists in all deployment configurations so wanting to see if anyone else recognised it and had any remediation.
UPDATE - This only occurs when the console app is built in 64-bit mode, when it's built as 32-but it runs as expected.