sveerap
sveerap

Reputation: 841

COM Interop issue in IIS - object creation failing

I am consuming an activex/com object (generated by Unify Vision application) in one of my asp.net application. I am getting the following error.

System.InvalidCastException: Creating an instance of the COM component with CLSID {9C2D0002-3A17-11E0-8000-FC9865BE5C68} from the IClassFactory failed due to the following error: 80004002.

I tried the following approaches

  1. I tried to consume the activex/com object in console application. There I am able to create the object and got the result (though the app is hanging after that)

  2. If I run the asp.net app in visual studio with built in web server (casino) and file system as the option(without deploying it to IIS) , it's working.

  3. But when I deploy it to IIS,it's failing. Even I tried impersonation , registry permissions and gave aspnet account/iis launcher account the admin privileges. But no use. I tried unistalling and reinstalling of the activex/com object but nothing is working.

I am currently running out of ideas. Please help.

Thanks, sveerap

Upvotes: 0

Views: 1625

Answers (1)

Eben Roux
Eben Roux

Reputation: 13256

Your COM component may require an STA thread to run on. Try starting up an STA thread and running the code on there. Just to test.

Upvotes: 1

Related Questions