microsoft / ManagedEsent

MIT License
242 stars 36 forks source link

Windows 11 support #50

Open mrthaggar opened 2 years ago

mrthaggar commented 2 years ago

The most recently available version does not work when attempting to access ESENT databases from Windows 11.

The error generated when attempting the call Api.JetAttachDatabase is:

InitializeConnection failed to initialise ESE database - Database engine is incompatible with database

Any ideas if/when this will be updated?

Thanks

mwinterb commented 2 years ago

Are the database files from Windows 11, and you're trying to access them from a pre-Windows 11 OS? Or are you running your software on Windows 11?

mrthaggar commented 2 years ago

The files are from a Windows 11 system, and I'm trying to read them on Windows 10.

So, for example the SRUDB.dat from a Windows 11 system fails, when using the library on Windows 10


From: mwinterb @.> Sent: 04 December 2021 04:33 To: microsoft/ManagedEsent @.> Cc: mrthaggar @.>; Author @.> Subject: Re: [microsoft/ManagedEsent] Windows 11 support (Issue #50)

Are the database files from Windows 11, and you're trying to access them from a pre-Windows 11 OS? Or are you running your software on Windows 11?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/microsoft/ManagedEsent/issues/50#issuecomment-985965699, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AF24FVFES2E5B4C2AA6PO53UPGKY5ANCNFSM5JJ4UMZQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

mwinterb commented 2 years ago

I've been trying to find documentation stating it, but I haven't been successful. But: ESENT database files will contain backwards compatible-breaking changes with new Windows versions (I don't know how the Windows 10 series was handled, maybe only when LTSB versions of it / Server were released?). So Windows 11 can read files from Windows 10, which can read 8.1, which can read 8. But Windows 8.1 cannot read files from Windows 10. This is true even if you're not using any features from a later version. Since ManagedEsent is a "thin" layer over the Windows esent.dll rather than a re-implementation of the database engine, there's nothing that can be updated. I don't know if it's supported, but perhaps building https://github.com/microsoft/Extensible-Storage-Engine/ and this project from scratch (updating https://github.com/microsoft/ManagedEsent/blob/3a486ccc621056fe4c15e234b33e18c727c92630/EsentInterop/Esent/EsentNativeMethods.cs#L20 to point to your new DLL) would work if you only need read-only access (since writes may make the database unreadable on older OS's).

mrthaggar commented 2 years ago

Thanks for the info.

I'll give what you suggested a try, and let you know how I get on.

mrthaggar commented 2 years ago

Based on your suggestion, I rebuilt both libraries from scratch, and this time used the esent.dll I pulled from a Windows 11 installation.

The library is now working, as is able to read from the Windows 11 databases, on Windows 10.

Thanks for your help.

CBenghi commented 2 years ago

Hello, I wonder if there are any plans to start a distribution of the interop that packs the dll like suggested in this thread. This would allow to read/write shared from multiple clients without concerns for the version of Esent.dll shipped with the OS.

As far as I can tell this would be compatible with the MIT licenses of the c++ and c# interop libraries.

Any views? Thanks Claudio

hsing1120 commented 2 years ago

hi,mrthaggar could you provide new dll for win11?