feat: support 32-bit Office environments (AnyCPU build + ACE provider auto-detection) - #1
Open
KoyaMuramatsu wants to merge 4 commits into
Conversation
…vider auto-detection Users with 32-bit Microsoft Office installed cannot install the 64-bit ACE redistributable (Microsoft limitation - bitness must match). This change makes the server work in both 32-bit and 64-bit Office environments. Changes: - csproj: PlatformTarget x64 -> AnyCPU, remove win-x64 RuntimeIdentifier - OleDbService: add DetectOleDbProvider() that probes ACE 16.0 then falls back to ACE 12.0 automatically - ComInteropService: same provider auto-detection via ResolveOleDbConnectionString() - AccessMcpOptions: add OleDbProvider property for explicit override - appsettings.json: expose OleDbProvider as null (auto-detect by default) The explicit override allows users to pin a specific provider in appsettings.json: "OleDbProvider": "Microsoft.ACE.OLEDB.12.0" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
added 3 commits
March 12, 2026 12:02
AnyCPU on a 64-bit OS defaults to running as a 64-bit process. 32-bit Office only installs the 32-bit ACE OleDB provider, which a 64-bit process cannot load. Prefer32Bit=true ensures the process runs as 32-bit and can use the existing 32-bit ACE driver.
…bility Prefer32Bit=true has no effect in .NET 5+ on 64-bit OS. Only a true 32-bit process can load 32-bit ACE OleDB provider. win-x86 + SelfContained=true bundles the 32-bit .NET runtime, so it works regardless of what .NET runtime the user has installed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Users with 32-bit Microsoft Office installed cannot use this server.
Microsoft's policy forbids installing the 64-bit ACE redistributable alongside 32-bit Office — they must match in bitness. Since the server is currently built as
x64and hardcodesMicrosoft.ACE.OLEDB.16.0, it fails entirely on machines with 32-bit Office, which is still very common in enterprise environments.Error observed:
Solution
Two changes make the server work transparently in both environments:
1.
AnyCPUbuild targetChanged
PlatformTargetfromx64toAnyCPUand removed thewin-x64RuntimeIdentifier. This allows the process to run as 32-bit on systems where 32-bit ACE is the only option.2. OleDB provider auto-detection
Instead of hardcoding
Microsoft.ACE.OLEDB.16.0, the server now:AccessMcp:OleDbProviderinappsettings.json(explicit override)ACE.OLEDB.16.0— uses it if available (64-bit systems)ACE.OLEDB.12.0— used on 32-bit Office systemsThis is implemented in:
OleDbService.DetectOleDbProvider()— used by all data operationsComInteropService.ResolveOleDbConnectionString()— used by VBA/COM tools3. Explicit override via
appsettings.jsonUsers who need to pin a specific provider can set:
{ "AccessMcp": { "OleDbProvider": "Microsoft.ACE.OLEDB.12.0" } }Files Changed
MS.Access.MCP.Server.csprojx64→AnyCPU, removedRuntimeIdentifierOleDbService.csDetectOleDbProvider()with 16.0→12.0 fallbackComInteropService.csResolveOleDbConnectionString()with same logicAccessMcpOptions.csOleDbProviderpropertyappsettings.jsonOleDbProvider: null(auto-detect default)Compatibility