Trying to Connect to Quality Center using VS Express 2012 gives System.BadImageFormatException error

1

I am trying to Connect to Quality Center using a WPF application on Visual Studio Express 2012. My system configuration is Windows 7 64 bit.

I have added a reference to OTAClient.dll in the project. The Embedded Interop types property for this dll is set to true.

Searching for similar problems gave solutions like setting the project target platform to x86, but the solution didn't work for me.

I am getting the error

Retrieving the COM class factory for component with CLSID {C5CBD7B2-490C-45F5-8C40-B8C3D108E6D7} failed due to the following error: 800703e6 Invalid access to memory location. (Exception from HRESULT: 0x800703E6).

I also tried registering the dll using regsvr32.

Can someone help me with figuring out the problem.

wpf
visual-studio
.net-4.0
visual-studio-2012
hp-quality-center
asked on Stack Overflow May 8, 2013 by bamittal • edited May 8, 2013 by bamittal

1 Answer

0

I Managed to solve this problem. This error has to some with DEP compatibility. The program is generating DEP exceptions and to clear it we have to clear IMAGE_DLLCHARACTERISTICS_NX_COMPAT flag.

This can be done by adding post build event in Visual Studio

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

Refer stack over flow question How to make my program DEP-compatible?

answered on Stack Overflow May 9, 2013 by bamittal • edited May 23, 2017 by Community

User contributions licensed under CC BY-SA 3.0