An error occurred while initializing the DocProject Add-In

Topics: Bugs
Feb 24, 2009 at 10:09 PM
After installing DocProject-1110RC.exe on both VS2008 & VS2005 I have the same error when starting Visual Studio:

Event Type: Error
Event Source: DocProject
Event Category: None
Event ID: 0
Date:  02/24/2009
Time:  5:03:33 PM
User:  N/A
Description:
An error occurred while initializing the DocProject Add-In.

System.InvalidCastException: Unable to cast object of type 'DaveSexton.DocProject.Configuration.AddinSection' to type 'DaveSexton.DocProject.Configuration.AddinSection'.
   at DaveSexton.DocProject.DocProjectEnvironment.Initialize()
   at DaveSexton.DocProject.DocProjectEnvironment.Initialize(IEnvironmentHost hostUI)
   at DaveSexton.DocProject.DocProjectAddIn.Extensibility.IDTExtensibility2.OnStartupComplete(Array& custom)

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Any ideas how to fix it?

Feb 24, 2009 at 10:58 PM
Hi,

Do you have any older versions of DocProject that perhaps weren't uninstalled (successfully)?  Do you have any custom rebuilt versions installed?

The error is an indication that different versions of the same assembly have been loaded into the process, probably from the GAC.  You can view the GAC contents by opening Windows Explorer to "%WinDir%\assembly" and look for DaveSexton.DocProject.  There should be only one and it should be version 1.11.0.0.

Some of the really older versions of DocProject didn't uninstall all components.  For help cleaning them up you'll find some guidance in the following article:

How To Uninstall DocProject
http://www.codeplex.com/DocProject/Wiki/View.aspx?title=How%20To%20Uninstall%20DocProject

- Dave
Feb 25, 2009 at 2:13 PM
Yes, I had the version 1.6.2 installed but thought that the installator will handle it. I uninstalled both versions, installed the new one and I'm fine now.
Perhaps, it makes sense add this error into installation FAQ.

Thanks for your help.