New Project Wizard Error - attempt to load a program with an incorrect format

Topics: General Questions
Jan 4, 2011 at 7:42 PM

I have a new install of DocProject in VS2005, the install appears to have been successful but when I attempt to create a new DocProject project I get an error from the New Project Wizard:

"An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x800700B)"

My software versions are:

  • Microsoft Windows XP Professional Version 2002 SP3
  • Microsoft Visual Studio 2005 Version 8.0.50727.762  (SP.050727-7600)
  • Microsoft .NET Framework Version 2.0.50727 SP2

I had initially had the newer version of Sandcastle installed to work with Sandcastle Help Builder and did install DocProject with that (getting the same errors). This morning I removed both DocProject and Sandcastle and reinstalled both the Sandcastle May 2008 release and DocProject 1.11.0RC release. I've gone through all of the steps in the Release Notes and now I'm stuck. Any help which the forum members could provide would be helpful.

When I run the New Project Wizard, I can go through all of the dialogs to the "Finish" button, the only dialog where I select anything other than the default is where the sources are chosen. I choose a .exe and it's related .dll file.

After clicking on "Finish" I see the DocProjectX project show up in Solution Explorer and different files get populated under it. Then the error occurs. Each time this error occurs, two events are logged to the Application Event log.

FIRST EVENT -

An error occurred while running the New Project Wizard:

System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
   at VSLangProj.References.AddProject(Project pProject)
   at DaveSexton.DocProject.VSAnyProject.AddReference(Object projectReference)
   at DaveSexton.DocProject.Wizards.ChooseSourcesStep.WizardFinished(WizardController controller)
   at DaveSexton.DocProject.Wizards.Foundation.WizardStep.WizardFinishedInternal(WizardController controller)
   at DaveSexton.DocProject.Wizards.Foundation.WizardController.<>c__DisplayClass9.<Finish>b__8(WizardStep step)
   at DaveSexton.DocProject.Wizards.Foundation.WizardController.ForEachStep(Action`1 action)
   at DaveSexton.DocProject.Wizards.Foundation.WizardController.Finish(Boolean canceled)
   at DaveSexton.DocProject.Wizards.Foundation.WizardForm.finishButton_Click(Object sender, EventArgs e)

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

SECOND EVENT -

An error occurred while attempting to load the Help 2.x compiler:

System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {314111B4-A502-11D2-BBCA-00C04F8EC294} failed due to the following error: 80040154.
   at DaveSexton.DocProject.Sandcastle.Help2CompilerLoader.LoadAssembly()
   at DaveSexton.DocProject.Sandcastle.Help2CompilerLoader.LoadAssembly(AssemblyName name)

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

 

I haven't loaded the Visual Studio SDK since I wasn't selecting to generate Help 2.x files and the Release Notes indicated that this was optional. I did check for an extra DXROOT environment variable in the User environment variables and did not find it there. The DXROOT environment variable defined in the system environment variables appears correct.

Thanks.

Jan 5, 2011 at 7:51 PM

It seems like the second error event mentioned above means that the Visual Studio SDK isn't "optional". To rule Visual Studio SDK absence out as a source of the errors, I went ahead and installed it.

After installing Visual Studio SDK (2005) and deleting the User environment variable for DXROOT, the SECOND EVENT mentioned in my original post went away.

In the release notes under Help 1.x there is a link to "HTML Help Workshop", but when I went to install it I got a message that I already had a newer version installed. Could there be a mismatch in versions of the HTML Help Workshop causing  the FIRST event?

Thanks.

John

Coordinator
Jan 7, 2011 at 4:05 PM
Edited Jan 7, 2011 at 4:06 PM

Hi John,

The issue is most likely that DocProject has some dependencies on VS 2008 components.  Thus VS 2008 may need to be installed before DocProject will work in VS 2005.  I remember testing against VS 2005 though, so perhaps I didn't realize that there were still dependencies on VS 2008 components since it was installed on my computer.

I'm not sure if it would help, but you could try installing Visual C# Express 2008 since it's a quick and free installation.  That may provide the missing components that you need to run DocProject.

Sorry for the inconvenience.

- Dave

Jan 10, 2011 at 5:19 PM
davedev wrote:

Hi John,

The issue is most likely that DocProject has some dependencies on VS 2008 components.  Thus VS 2008 may need to be installed before DocProject will work in VS 2005.  I remember testing against VS 2005 though, so perhaps I didn't realize that there were still dependencies on VS 2008 components since it was installed on my computer.

I'm not sure if it would help, but you could try installing Visual C# Express 2008 since it's a quick and free installation.  That may provide the missing components that you need to run DocProject.

Sorry for the inconvenience.

- Dave

Dave,

Thanks for the suggestion. Unfortunately, that didn't solve the problem, I got the same error after installing Visual C# Express 2008.

Since I'm working on a fairly small reverse engineering project, I used a utility to convert over to Doxygen format comments and can run Doxygen separately from the IDE. It looks like this will work well enough for me. Thanks for your help!

John