Quantcast
Channel: NetOffice - MS Office in .NET
Viewing all articles
Browse latest Browse all 1741

Created Unassigned: An extra "CodeBase" registry value for COM Addin [21224]

$
0
0
When I use NetOffice to creates an Excel COM Addin whose assembly version is not 1.0.0.0 and registers it using RegAsm.exe with /codebase option, an extra "CodeBase" registry value is created under a (non-exisitng) assembly version 1.0.0.0. When unregistering it using RegAsm /unregister, the registry entries for the version 1.0.0.0 is left unremoved in the registry.

RegAsm creates a set of correct registry entries for the Assembly's correct version, as well as an extra entry for 1.0.0.0, so the registered COM Addin works. Also, unremoved registry entries do nothing critical (except for slightly wasting the registry.) So, this is a relatively minor issue.

REPRODUCTION STEPS

1. Run NetOffice Developer Toolbox, choose VS Project Wizard, then create an Automation Addin project for Excel.
2. Open the generated project with Visual Studio.
3. Open the property page for MyAssembly project, choose Application tab, click on Assembly Information..., then change the Assembly version to, say, 1.2.3.4.
4. On Build tab, uncheck "Register for COM interop" so that VS doesn't update the registry.
5. Build the solution to create MyAssembly.dll.
6. Open an Administrator Command Prompt, cd to the directory where MyAssembly.dll resides, and run regasm MyAssembly.dll /codebase
7. Run RegEdit and examine the entries below the COM Addin's CLSID.

OBSERVED BEHAVIOUR

Below the InprocServer32 registry key, I see two subkeys: 1.0.0.0 and 1.2.3.4. Below 1.0.0.0 there is a registry value "CodeBase". (Registry values below 1.2.3.4 are fine, BTW.)

See the attached .reg file for details. Lines 18 and 19 are unwanted. (I'm on 64 bit Windows and developing a 32 bit addin, so the registry keys are below Wow6432Node.)

EXPECTED BEHAVIOUR

Below the InprocServer32 registry key, I see only one subkey 1.2.3.4.

GUESSED CAUSE

NetOffice.ExcelApi.Tools.COMAddin.RegisterFunction(Type) contains a code to add a "CodeBase", which I suspect is misbehaving. (Although I'm not sure it is really the cause of the issue nor what is the intended purpose of the code...)

ENVIRONMENT

Windows 7 (64 bit), .NET Framework 4.0, Visual Studio 2013 Express, NetOffice 1.6, Toolbox 1.2.

Viewing all articles
Browse latest Browse all 1741

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>