Avatar of Michel Sakr
Michel Sakr
Flag for Canada asked on

System.InvalidCastException: QueryInterface for interface

I have a managed code that is calling unmanaged Com+ vb6 code , I always get this error for 1 component , other are working ok:
This component used to work ok..
One fact is that this is a webfarm cluster on several machines we are having the same problem
I traced the error on the web and it says (the closest) that this error might be due to threading conflicts (the unmanaged component is running in single app mode) but I repeat this used to work!

any clues?
Web Components.NET Programming

Avatar of undefined
Last Comment
Michel Sakr

8/22/2022 - Mon

I am assuming that you ae invoking your invoking unmanaged serviced  componenet from web form...
I Am asure you must have tried this.. but let me ask. Did you try setting aspCompat attribute to put ASP.Net thread as STA because all VB6 components are STAs.
Michel Sakr

yes it is set in the directive to true
Michel Sakr

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck