0

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.

5
  • 1
    What is the question? To me this seem like a bug in the library, and you might have limited recourse except using the older version. Even if you where to use the library incorrectly I would have expected it to fail with some kind of argument exception, not an access violation. Commented Aug 26 at 14:55
  • Thanks @JonasH, I've added a para with the question but really just seeking anyone else's experience here and whether we've missed something in terms of pre-reqs as it seems unlikely the package would be released with this affecting all deployment scenarios. Agree that we may have to use the older version but that's only in support until June '26 and we'd rather be on the latest. MS docs say to seek support here or raise a support case with MS so trying here first. Commented Aug 27 at 8:16
  • You could try updating vcredist, since that is a common dependency issue with native code. But I think that should fail with a load failure, not an access violation. You could also check if you can reproduce the issue in a new minimal project, ideally following the documentation to the letter. Commented Aug 27 at 8:46
  • We've made sure we have the latest vcredist (14.44.35211) on the target env, both 86 and 64 bit versions are deployed, and the issue persists. I've built a basic app that exhibits the issue which I can share with MS - as part of testing it out I also determined the issue only occurs when the app is built in 64 bit mode though, 32-bit works fine, so I've updated the question again to reflect that Commented Aug 27 at 15:36
  • Looks and sounds like a bug in Microsoft.InformationProtection implementation, you should contact Microsoft Commented Aug 28 at 6:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.