ClassInitialize method with com objects RRS feed

  • Question

  • I use APL dyalog (COM) in my windows application. While runnig test i open my Windows application(which inturn start APL dyalog as it uses it) in the class Initialize method. I close my application in the ClassCleanUp. But when i run two tests, APL dyalog is not available for the second test and gives me an error as "COM object that has been separated from its underlying RCW cannot be used."

    I searched in the net and added <ExecutionThread apartmentState="MTA" /> in testrunconfig file. I closed and reopened my VS 2008 as suggested in the help but have no luck.

    Any help in this is appreciated.

    Monday, March 8, 2010 2:40 PM


  • Hello Anu,

    You may recreate the COM object each time to see if this issue still exists. I have found one thread in the fourm you could refer to to see if it helps:

    As this issue is truly more related to how corresponding language and CLR works, you may also post on the corresponding language general forum so you can get better and quicker response.

    Thanks for your understanding.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
    Wednesday, March 10, 2010 4:30 AM