Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

ASP.NET and COM object.

I have an asp.net page with some c# codebehind.  The c# trys to create an instance of a COM object (written in delphi) but hangs.

I can create a similar winform application and the COM object gets created.

After various searches I found that the ASPNET user may not have the permission to create this object.  One solution to this is to modify the machine.config file'd processmodel section setting the username attribute to SYSTEM, basically running asp.net applications as an admin of the machine.

This is think is very bad...running the process as a machine admin....

...any suggestions?

Yo
Thursday, May 27, 2004

Grant ASPNET permissions to do what it needs to do on whatever files/registry keys etc it's trying to use. Use filemon and/or regmon (http://www.sysinternals.com ) to see what permissions are required where.

Duncan Smart
Thursday, May 27, 2004

The ASPNET account is not prohibited from generally creating COM objects. In fact, there is no such permission called "create COM object".

There are a couple security vectors that might be causing the problem:

1. Make sure ASPNET can read the section of HKEY_CLASSES_ROOT that described the object (seems pretty unlikely that this is wrong, though).

2. Make sure ASPNET can access the actual DLL file (just needs read access, also seems pretty unlikely).

Since you didn't describe the actual failure, we can't be much more helpful. Sorry.

Brad Wilson (dotnetguy.techieswithcats.com)
Friday, May 28, 2004

There's a method by which you give permissions explicitly. I think the command line to bring up the configuration for this is "dcomcnfg". Once there, you have to give the ASPNET (and maybe the IIS accts.. not sure) "launch" permissions on the object.

Another method might be to install the COM object in the COM+ Snap-In, then go into properties and choose the security tab. There's an option you can de-select that says "enforce security checks on this component" or something like that.

I've seen this a few times before on our web servers, and these are 2 of the ways I've fixed this before.

Nick Ruisi
Thursday, June 17, 2004

*  Recent Topics

*  Fog Creek Home