Cannot Register Assembly

Add-in Express™ Support Service
That's what is more important than anything else

Cannot Register Assembly
 
Kevin Gorski




Posts: 8
Joined: 2010-09-08
After trying some other things out, I found that if I add a MAPI store accessor to the empty test project it starts to fail during installation the same way that my main project is.

If I remove the MAPI store accessor from my main project it installs without a problem again, so it seems that that is the problem.
Posted 09 Sep, 2010 18:33:22 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Kevin,

Exactly! I saw in the log:

12:45:10 460 2636 Loading CLR: v4.0.30319.


The MAPI Store Accessor doesn't support .net framework 4.0. That is the cause of the issue :-)
.NET, Extended MAPI, Windows Phone & RT
Posted 10 Sep, 2010 07:16:29 Top
Kevin Gorski




Posts: 8
Joined: 2010-09-08
The 4.0 framework was installed via an update, but our project is targeting 3.5. Shouldn't the loader use the target version rather than the latest one (as it says in the log)?
Posted 10 Sep, 2010 11:09:09 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Kevin,

The loader should use the target framework. But according to the log file you listed above:

1. Only .net framework 4.0 is installed.
2. The target framework of the add-in project is .net 4.0.

Usually I see in the log the following text (the target framework property was set to .net framework 2.0):

The latest CLR version is 'v4.0.30319'.
The configuration has been loaded successfully.
Runtime version: v2.0.50727.
Assembly name: asm, Version=1.0.0.5, Culture=neutral, PublicKeyToken=b9c46ghf08eg0f4c.
Class name: asm.name.
Attempting to create a new instance of the managed class: CLR - v2.0.50727
Loading CLR: v2.0.50727.
.NET, Extended MAPI, Windows Phone & RT
Posted 10 Sep, 2010 12:48:05 Top
Kevin Gorski




Posts: 8
Joined: 2010-09-08
I don't mean to be argumentative, but there are versions of the .NET framework prior to 4.0 installed on the machine in question. The installer was running fine on the same machine with our add-in project targeting v3.5 a few weeks ago.

This morning I changed the test project to target 2.0 explicitly and updated the setup project to have 2.0 as a prerequisite and set the detected dependency to 2.0. The installer still does not complete.
Posted 10 Sep, 2010 13:43:11 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Kevin,

This morning I changed the test project to target 2.0 explicitly and updated the setup project to have 2.0 as a prerequisite and set the detected dependency to 2.0. The installer still does not complete.


I have just created a new COM add-in with MAPI Store Accessor. Set the target framework property to .net 2.0 and registered it. Then I started the host application (Outlook) and noticed that my add-in is loaded correctly. Anyway, the adxloader.log file states:

14:43:32 3528 3952 Start.
14:43:32 3528 3952 Reading the registry key '___'
14:43:32 3528 3952 Success. The registry key '___' is closed.
14:43:32 3528 3952 Converting the '___' CLSID from string.
14:43:32 3528 3952 Success.
14:43:32 3528 3952 Attempting to get the class object by the '___' CLSID.
14:43:32 3528 3952 Success.
14:43:32 3528 3952 Creating a new instance of the add-in loader.
14:43:32 3528 3952 Success.
14:43:32 3528 3952 Loading the configuration from the system registry.
14:43:32 3528 3952 Getting the latest CLR version.
14:43:32 3528 3952 The latest CLR version is 'v4.0.30319'.
14:43:32 3528 3952 The configuration has been loaded successfully.
14:43:32 3528 3952 Runtime version: v2.0.50727.
14:43:32 3528 3952 Assembly name: MyAddin4, PublicKeyToken=E11552B2CAE6EE57.
14:43:32 3528 3952 Class name: MyAddin4.AddinModule.
14:43:32 3528 3952 Attempting to create a new instance of the managed add-in class: CLR - v2.0.50727
14:43:32 3528 3952 Loading CLR: v2.0.50727.
14:43:32 3528 3952 Calling CLRCreateInstance method.
14:43:32 3528 3952 Success.
14:43:32 3528 3952 Calling GetRuntime method.
14:43:32 3528 3952 Success.
14:43:32 3528 3952 Calling GetInterface method.
14:43:33 3528 3952 Calling GetInterface method for the CorRuntimeHost interface.
14:43:33 3528 3952 Success.
14:43:33 3528 3952 Starting CLR...
14:43:33 3528 3952 Success.
14:43:33 3528 3952 The CLR v2.0.50727 has been initialized successfully.
14:43:33 3528 3952 Creating a new domain setup.
14:43:33 3528 3952 Success.
14:43:33 3528 3952 Getting the add-in directory.
14:43:33 3528 3952 Success. The directory is 'C:\Users\Eugene\Desktop\MyAddin4\MyAddin4\bin\Debug\'
14:43:33 3528 3952 The configuration file is 'C:\Users\Eugene\Desktop\MyAddin4\MyAddin4\bin\Debug\app.config'
14:43:33 3528 3952 The 'shadow copy' is enabled.
14:43:33 3528 3952 Creating a new application domain.
14:43:33 3528 3952 Success.
14:43:35 3528 3952 Unwrapping the managed class.
14:43:35 3528 3952 Success.
14:43:35 3528 3952 Querying the add-in extensibility.
14:43:35 3528 3952 Querying the custom task panes.
14:43:35 3528 3952 Querying the ribbon extensibility.
14:43:35 3528 3952 Success.
14:43:35 3528 3952 Querying the form regions.
14:43:35 3528 3952 Success.
14:43:35 3528 3952 Getting the dispid of the 'Dispose' method.
14:43:35 3528 3952 Success.
14:43:35 3528 3952 The managed add-in class has been created successfully.

Could you please send a sample add-in project which can reproduce the issue to me for testing (see readme.txt)?
.NET, Extended MAPI, Windows Phone & RT
Posted 13 Sep, 2010 06:47:53 Top
Kevin Gorski




Posts: 8
Joined: 2010-09-08
I've sent my project to the support email address. The project registers through Visual Studio ok, but the installer fails.
Posted 13 Sep, 2010 12:53:51 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Kevin,

Thank you for providing me with a sample project. I couldn't reproduce the issue you described on my PC.

Please try to move initialization of the MAPI Store Accessor to the AddinInitialize event handler.
.NET, Extended MAPI, Windows Phone & RT
Posted 14 Sep, 2010 09:20:40 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Kevin,

What versions of .net framework do you have installed on the problematic PC?
.NET, Extended MAPI, Windows Phone & RT
Posted 14 Sep, 2010 09:22:36 Top
Kevin Gorski




Posts: 8
Joined: 2010-09-08
Moving the creation of the ADXMAPIStoreAccessor to AddinInitialize seems to have fixed the installer.

Framework folders listed in %windows%\Microsoft.NET\Framework:
v1.0.3705
v1.1.4322
v2.0.50727
v3.0
v3.5
v4.0.30319

In Framework64

v2.0.50727
v3.0
v3.5
v4.0.30319

In add or remove programs, it looks like it's actually the 4.0 Client Profile and an entry for "Microsoft .NET Framework 4 Extended".
Posted 14 Sep, 2010 14:18:58 Top