com+ System.InvalidCastException: QueryInterface for interface failed 
Author Message
 com+ System.InvalidCastException: QueryInterface for interface failed

I've an asp.net application that calls a com+ application. On several
machines (not all), I've this error when the asp.net code calls the com+
code.

On component services I see my class running (1 object - 1 activated), and
if I reload the page this counter grows.

What can I do?



Tue, 20 Sep 2005 23:48:34 GMT  
 com+ System.InvalidCastException: QueryInterface for interface failed
I have encountered a similar issue in classic ASP. Maybe the following
will help.

What is the user that your COM+ application is running under. You can
check this by doing the following:

1. START -> Run

2. Type "dcomcnfg"

3. Seach for your COM+ program id or name.

4. Click on properties

5. Under the "Identity" tab, what option is being checked?

If "The launching user" is checked, then that means the user that
makes the request in your ASP.NET application is launching your COM+
application. If you are using anonymous access, then each request
might have a slight different security context. In that case, a new
instance of your COM+ application will be created for each of these
request.

To ensure that only one instance of your COM+ application is running,
you will have to set the COM+ application to run under a local user
account on the server. You can do the following:

1. Create a local user account. Set this user as part of the "Power
user" group.
2. Open "Dcomcnfg" and go to the properties of your COM+ application
3. Under the "Identity" tab, select the "This user" option, and put in
the
   local user account, and the password of the account.
4. Restart the server.

From this point on, your COM+ application will run under the same user
(the local user account). Since the security context no longer
changes, you should then only see only one instance of your COM+
application.

Tommy,

Quote:

> I've an asp.net application that calls a com+ application. On several
> machines (not all), I've this error when the asp.net code calls the com+
> code.

> On component services I see my class running (1 object - 1 activated), and
> if I reload the page this counter grows.

> What can I do?



Fri, 23 Sep 2005 10:44:46 GMT  
 com+ System.InvalidCastException: QueryInterface for interface failed


Quote:
> I have encountered a similar issue in classic ASP. Maybe the following
> will help.

> What is the user that your COM+ application is running under. You can
> check this by doing the following:

> 1. START -> Run

> 2. Type "dcomcnfg"

> 3. Seach for your COM+ program id or name.

> 4. Click on properties

> 5. Under the "Identity" tab, what option is being checked?

I have two problems.

1 - I have not "identity tab" on this application. Why? My com+ application
is properly configured, running as serve application. Why this?

2 - If I remove the COM+ application and recreate it manually, I can't find
the prog id in dcomcnfg or in registry.

Have you got other suggestions?

However thanks for your support. I'm waiting for MS support (my account is
msdn registered.. "support within 72 hours guarantied"), but.... :-(((



Tue, 27 Sep 2005 22:46:59 GMT  
 com+ System.InvalidCastException: QueryInterface for interface failed
Hi Trapulo,

Here is the reposponse text posted by Leo Chen in the ASPNET newsgroup. Can you
follow through in that newsgroup? I am sorry but our internal tool does not
allow us to cross-post .

===============================================================

Date: Tue, 08 Apr 2003 14:15:17 GMT
Subject: RE: com+ System.InvalidCastException: QueryInterface for interface
failed
Newsgroups: microsoft.public.dotnet.framework.aspnet

Hi Trapulo,

I wonder if you have installed latest Windows updates from the Windows
Update web site? I'm including the URL below for your convenience:

http://windowsupdate.microsoft.com

We will also need to obtain the latest COM+ update by submitting a support
incident. Please note that you won't be charged for obtaining updates only.
For your convenience, I'm including the URL below:

http://support.microsoft.com/support/webresponse.asp

For more information about the latest COM+ updates, please check the
articles below:

330227 INFO: Availability of Windows XP COM+ Hotfix Rollup Package 5
http://support.microsoft.com/?id=330227

330081 INFO: Availability of Windows 2000 Post-Service Pack 3 COM+ Hotfix
http://support.microsoft.com/?id=330081

Best Regards,
Leo Chen

This posting is provided "AS IS" with no warranties, and confers no rights.

===============================================================

Hope this helps!
Bharat Patel
Microsoft, Visual Basic .NET

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks.              



Wed, 28 Sep 2005 05:40:36 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. System.InvalidCastException when moving Com based WebService to distributed platform

2. QueryInterface for interface myComponent._component failed

3. Help, Com/IIS/XP issue "QueryInterface for interface Project2._Class1 failed."

4. QueryInterface in IDirectory failed?

5. Queryinterface in IDirectory Failed

6. Newbiw COM Question - COM Interface?

7. Confused by COM terminology: interfaces, coclasses, and COM classes

8. COM Interfaces, VB6 COM Servers, Automation Clients

9. Urgent:: Use of COM/COM+ and XML data to interface Oracle DB, best practices

10. Deleting an interface from Com+ application

11. Problem passing VB COM+ ASP Request object to .NET component System.Web.HTTPRequest through COM interop

12. Extending the Outlook interface to include COM objects

 

 
Powered by phpBB® Forum Software