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
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)
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.
But when I deploy it to IIS,it's failing. Even I tried impersonation , registry permissions and gave aspne开发者_运维技巧t 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
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.
精彩评论