NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

System.InvalidCastException in 2008 R2 64 bit

we are executing a method from a DLL in Test Stand 2010. During run time we get an exception

 

An error occurred while calling .NET member 'Main_SaveProjects':
The type initializer for 'TA_CCB_Helper.Main_SaveProjects' threw an exception.
Unable to cast COM object of type 'WindowAutoTestHelper2.TestWindowClass' to interface type 'WindowAutoTestHelper2._TestWindow'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{B0E13172-DE83-4BC6-80EA-0A8D484B7F89}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

 

This same Seq we were able to execute on windows 7 32 bit without any issues. but on 2008 R2 we are facing this issue. Attaching the screenshot and machine details. We already raised this issue with TS support team but they require the DLL and the source code. But for security reasons we can give them out.

 

If anybody faced a similar issue and could solve it, please reply

regards

Download All
0 Kudos
Message 1 of 3
(2,709 Views)

Most likely the problem is with the COM server you are trying to access and has nothing to do with TestStand. What can happen is there might be both a 64-bit and 32-bit version of the COM server you are using. If you have both versions installed or only the 64-bit version that could be leading to this problem. If you have both versions installed, make sure you are referencing the correct (i.e. 32-bit) version from your .NET code. You might try contacting the creator of the COM server (if it is from a 3rd party) for support.

 

Hope this helps,

-Doug

0 Kudos
Message 2 of 3
(2,702 Views)

Thanks for the reply Doug. I do not think the problem is on the 32 or 64 bit versions of the COM server because, I could replicate this issue on 2008 32 bit server too. Only i did not mention this because TS 2010 does not support 2008 32bit server. Though I agree with you that the problem might be with the COM server itself.

0 Kudos
Message 3 of 3
(2,686 Views)