Using Microsoft Office DLLs registration free?

553 views Asked by At

I'm working on a C# application that needs to be able to connect to an MS Access database and use some of the database objects stored there.

Since some of the people who later on might have to make some minor changes in the Access related code are mainly familiar with VBA and DAO, we decided to use the ACEDAO.dll (via Microsoft.Office.Interop.Access.Dao PIA), in order to keep the syntax as familiar as possible.

Referencing the mentioned PIA I can easily use the necessary Access specific types in Visual Studio 2015 and the application compiles perfectly well. However, when starting the debugging process I quickly run into an exception:

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

Additional information: Retrieving the COM class factory for component with CLSID {CD7791B9-43FD-42C5-AE42-8DD2811F0419} failed due to the following error: 80040154 class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

While I have Office 2013 installed it appears the referenced DLL (ACEDAO.DLL) is not registered. I was able to fix this by simply downloading and installing the Access Runtime from Microsoft, after this the corresponding .dll is registered and the application works fine.

The problem is, installing the Access Runtime needs administrator privileges which is not a realistic option for the client PCs. All PCs that will have to run the application have the same Office version installed as my developer machine, and the ACEDAO.dll is among the program files, but not registered... Is it possible to use this library without the need of registering it?

Referencing the ACEDAO.dll in the Office installation folder allowed me to set the "isolated" property to true. While this got me quite a few warnings when building (Problem isolating COM reference 'Microsoft.Office.Interop.Access.Dao' ... ) it compiled and copied the dll in the binary folder and created a manifest, but it still won't work without having the library registered (ecxception 0x8007013D from mscorlib.dll, no message text available)...

Any idea on whether and how it is possible to use the ACEDAO library without having it registered on the target machines?

0

There are 0 answers