This project has moved. For the latest updates, please go here.

KB3199209 cause failures on comaction in Windows 10 machines

Oct 27, 2016 at 12:03 PM
I have the following code that started failing recently.
I believe that it is related to KB3199209 being installed.

The code is basically:
            var dataDir = @"C:\work\test";
            var src = Path.Combine(dataDir, "Data");
            var compactPath = Path.Combine(dataDir, "Data.Compact");
            JET_INSTANCE compactInstance;
            Api.JetCreateInstance(out compactInstance, Path.Combine(dataDir, Guid.NewGuid().ToString()));
            Api.JetSetSystemParameter(compactInstance, JET_SESID.Nil, JET_param.EnableIndexChecking, 0, null);
            const int JET_paramEnableIndexCleanup = 54;

            Api.JetSetSystemParameter(compactInstance, JET_SESID.Nil, (JET_param)JET_paramEnableIndexCleanup, 0, null);
            Api.JetInit(ref compactInstance);
            using (var session = new Session(compactInstance))
                Api.JetAttachDatabase(session, src, AttachDatabaseGrbit.None);
                    Api.JetCompact(session, src, compactPath, null, null,
                catch (Exception e)
                    Api.JetDetachDatabase(session, src);

And the error is file in use

Program.cs -

a.imnotazip -