0

I'm writing a simple C# application to access defects in HP ALM -- Quality Center.

I'm using Visual Studio 2008, HP ALM Quality Center 11.0, and version 9.2.0.5089 of OTAClient.dll.

When I execute this line of code:

        TDConnection qctd = new TDConnection();

I get the following error:

"An unhandled exception of type 'System.BadImageFormatException' occurred in HPQCDataSet.exe

Additional information: Retrieving the COM class factory for component with CLSID {C5CBD7B2-490C-45F5-8C40-B8C3D108E6D7} failed due to the following error: 800703e6."

The approach suggested elsewhere for dealing with this situation involves adding some code like this as a post-build event:

call "$(DevEnvDir)..\tools\vsvars32.bat" editbin.exe /NXCOMPAT:NO "$(TargetPath)"

I've done that, and I've also set my Platform Target to x86, but the BadImageFormatException error still exists.

Any suggestions as to other steps I might try?

Steve
  • 543
  • 1
  • 6
  • 14
  • This is usually a 64bit issue, the executing application that communicates to the COM library needs to be x86 when built so if you have a Winforms app that creates the TDConnection make sure the *.exe is built against x86 – Jon Mar 09 '13 at 17:44
  • @Jon -- I thought that setting my Platform Target to x86 would take care of that. Is there something else I need to do? – Steve Mar 09 '13 at 17:49
  • It should be but are you sure the COM library is x86? – Jon Mar 09 '13 at 17:55
  • @Jon -- As far as I know it is, but I'm not positive. – Steve Mar 09 '13 at 19:38

1 Answers1

0

We were ultimately able to solve this problem by removing any existing instances of OTAClient.dll and re-registering it in HP ALM.

Steve
  • 543
  • 1
  • 6
  • 14
  • 1
    What exactly is HP ALM? How should I do this? can you help me by providing some steps? – Lance Dec 05 '13 at 09:06