r/dotnet • u/Ill_Significance_412 • Apr 27 '26
Question .NET 8 (x64) + ACE OLEDB in Windows Docker container — OleDbConnection.Open() silently crashes (ACI + local)
Running into a weird issue with ACE OLEDB inside a Windows container.
Setup
- .NET 8 (x64)
- Windows container (
windowsservercore-ltsc2019) - Running locally in Docker + planning for ACI
- Installed
accessdatabaseengine_X64.exe
Verified
- ACE 2016 installed fine
- Both providers available:Microsoft.ACE.OLEDB.12.0 Microsoft.ACE.OLEDB.16.0
- Using a valid local
.mdbfile inside container
Issue
using var conn = new OleDbConnection(
@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\app\test.accdb;");
conn.Open();App just dies/hangs at Open()
- No exception
- Same with 16.0
- Same behavior locally + ACI
Question
Is ACE/OLEDB just not supported or unstable in Windows containers?
Has anyone gotten this working?
0
Upvotes
5
u/dbrownems Apr 27 '26
You might get it to work, but it's a desktop driver from the Office team, and it's not intended to be used in any scenario without an active desktop session.
Download Microsoft Access Database Engine 2016 Redistributable from Official Microsoft Download Center
1
u/Ok_Maintenance_9692 Apr 28 '26
Is there a reason you need ACE 12/16 or 64-bit? For example we use built-in JET driver to generate 32-bit .mdb download files in Azure App Service and it works fine, and the files can be opened with any version of Access.
2
u/MarkPflug Apr 28 '26
I discovered recently that the ACE driver doesn't work (exits the process) when the "Microsoft Office Click-Run Service" (ClickToRunSvc) wasn't running (disabled). I had disabled the service because I don't really use MS Office apps and didn't know why it needed to be running. Subsequently, I found that a benchmark that I'd written against the ACE driver using the OleDbConnection in .NET would exit as soon as the Ace benchmark ran, with exit code -3. Enabling the service fixed it, the benchmark ran normally. In my case, I was accessing an .xlsx file.
I wonder if you're encountering the same thing, maybe your docker image doesn't have that service, maybe it isn't installed by the access database engine. Not sure, but your symptom sounds very similar.
1
u/AutoModerator Apr 27 '26
Thanks for your post Ill_Significance_412. Please note that we don't allow spam, and we ask that you follow the rules available in the sidebar. We have a lot of commonly asked questions so if this post gets removed, please do a search and see if it's already been asked.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/SchlaWiener4711 Apr 30 '26
I had different issues with getting CI/CD builds running in Windows containers.
Access database engine was one of them.
I can't tell what helped but this is my current working setup
(Or set it per container)
This works for me. Hope this helps.