VS Registration/Unregister Issue

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

VS Registration/Unregister Issue
 
Ron Waicus




Posts: 13
Joined: 2009-09-17
I'm getting the following whenever I register/unregister in Visual Studio, error and specifics follow:



Application Domain:    DefaultDomain
Assembly Codebase:     file:///C:/Program Files (x86)/Add-in Express/Add-in Express for .NET/Bin/Packages/VS2005/AddinExpress.Wizard.dll
Assembly Full Name:    AddinExpress.Wizard, Version=7.7.4087.2005, Culture=neutral, PublicKeyToken=4416dd98f0861965
Assembly Version:      7.7.4087.2005

Exception Source:      mscorlib
Exception Type:        System.IO.FileLoadException
Exception Message:     The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Exception Target Site: RegisterAssembly

---- Stack Trace ----
   AddinExpress.Projects.Common.Registrator.RegisterAssembly(rtmType As Int32, bMode As Int32, projectFolder As String, configurationName As String, primaryOutput As String, projectKind As String, projectFullName As String, manifestXllClass As String, manifestPublicToken As String, manifestAssemblyName As String, manifestConfigFileName As String, registerOutputState As Boolean, prismBugMode As Boolean, expressEdition As Boolean)
       AddinExpress.Wizard.dll: N 00000 (0x0) JIT 
   AddinExpress.Projects.Common.Registrator.DoAfterBuild(scope As vsBuildScope, action As vsBuildAction)
       AddinExpress.Wizard.dll: N 0570 (0x23A) IL 


Environment:
- VS2010 Professional, COM add-in (Word)
- No initialization of class vars being done in AddIn Constructor (they are defined but all are inited in AddinModule_AddinInitialize)
- Other Projects are referenced to the AddIn Express COM project
- Verified build order is correct
- At least one upgrade to Add-in express done during the life of the application (last upgrade may have caused this issue but did not notice until trying to register/unregister in VS)
- Two setup projects built as per posted instructions:
MSI per user (https://www.add-in-express.com/creating-addins-blog/2011/02/22/deploying-peruser-office-extension-msi-installer/) - used for targeted testing
Group Policy MSI (https://www.add-in-express.com/creating-addins-blog/2011/02/25/deploying-peruser-office-extensions-group-policy/) - used for firm deployment
- Interestingly, both setup projects build out without error and the add-in solution deploys on target machines without issues

Actions taken:
- Deleted bin folder contents - no change
- Manually removed registry keys etc. using "How your Office add-in is registered" as a reference (https://www.add-in-express.com/docs/net-deploying-addins.php). Although there may be some fragments still left. - no change
- Tried removing/reinstalling add-in express via add/remove programs - no change
- After performing the last operation, could not run the solution in debug (expected). However, if I then actually installed the per user MSI on the development workstation, I could at least debug the solution again. Not normally what I would do - have the published solution installed on the dev machine - but needed to continue working with the solution.

Any guidance on getting helping me get past this would be greatly appreciated!

Thanks
Ron
Posted 01 Oct, 2015 10:41:07 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Ron,

Make sure Add-in Express assemblies in the References section of your project have Copy Local set to false.


Andrei Smolin
Add-in Express Team Leader
Posted 02 Oct, 2015 03:44:29 Top
Ron Waicus




Posts: 13
Joined: 2009-09-17
Hi Andrei,

Thanks for the response.

The only specific Add-In Express reference I can see is already set to Copy Local: False
C:\Program Files (x86)\Add-in Express\Add-in Express for .NET\Bin\AddinExpress.MSO.2005.dll

The other references created when the add-in project was created, Word interop, Office.dll are set to copy local however.

In any case, I don't believe I changed any of the references since the project was created by the add-in express new project wizard.

Not clear on what the difference is between registering via visual studio vs registering via a setup project on the development workstation. The thing is that the setup project deployed on brand new client machines work (and for that matter when I deploy on the development workstation). Can there be something messed up on the development workstation with my GAC, registry etc.. Perhaps (with details on how to do so) I can systematically go though and clean up anything messed up so the registration can run cleanly as it did when creating the project? Just a thought.
Posted 02 Oct, 2015 09:26:13 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Ron Waicus writes:
Can there be something messed up on the development workstation with my GAC, registry etc..


Yes, it can. Especially if you installed the add-in or if you ever changed the RegisterForAllUsers property of the add-in or tried running adxregistrator.exe passing it different values of the /privileges parameter. Uninstall the add-in, unregister the add-in project and then check the registry for entries related to your add-in, please see section Locating COM Add-ins in the Registry at https://www.add-in-express.com/docs/net-deploying-addins.php.


Andrei Smolin
Add-in Express Team Leader
Posted 02 Oct, 2015 09:42:05 Top
Ron Waicus




Posts: 13
Joined: 2009-09-17
Hi Andrei,

Thank you for helping me work though this issue.

I probably made changes to some of those switches at some point.

Here's where I'm at currently:
- Remove add-in via add-remove programs
- Search entire registry for anything that has the add-in name or ProgId key / CLSID (as per link you supplied in the last post). Manually removed any fragments from HKLM / HKCU
- So, unless I missed something, there should be nothing left that should prevent "Register ADX Project" from executing as if it was a newly created ADX project.

Still getting the same error as posted initially. Error comes up regardless if I choose Register ADX Project (or Unregister ADX Project for that matter - even though nothing is registered).
Posted 02 Oct, 2015 14:40:33 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Ron,

Please make sure that all Add-in Express assemblies in the Reference section of your project have Copy Local set to false.


Andrei Smolin
Add-in Express Team Leader
Posted 05 Oct, 2015 07:31:44 Top
Ron Waicus




Posts: 13
Joined: 2009-09-17
Hi Andrei,

I've finally got the registration going.
I changed all of the references created by the add-in wizard to Copy Local: False. However, I was still getting the same error, but then proceeded to remove and re-reference the two other projects refs making up the solution - that was the trick to get it going. There was something messed up with those refs. Btw: those project refs are set to the default Copy Local: True

Thanks!
Ron
Posted 05 Oct, 2015 15:01:10 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
You are welcome!


Andrei Smolin
Add-in Express Team Leader
Posted 06 Oct, 2015 02:06:05 Top