AspNet4YouTop 10sDevelopers WorldForums
ASPNet Books
ASPNet Sites
ASPNet Hosters
View Articles
Search Articles
View Forums
Quick Menus
AspNet4You Forums
Articles Summary
AspNet Books
AspNet Sites
AspNet Hosters
 Top 10 ASP.NET Books 
Professional ASP.NET 1.1
Essential ASP.NET With Examples in C#
ASP.NET Unleashed
Programming Data Driven Web Applications with ASP.NET
Professional ASP.NET Web Services
Beginning ASP.NET 1.1 with Visual C# .NET 2003
Programming Microsoft ASP.NET
Beginning ASP.NET Databases Using VB.NET
ASP.NET Security
Developing Microsoft ASP.NET Server Controls and Components
 Top 10 ASP.NET Hosters 
ISQSolutions, LLC
Active ISP
Aquest Hosting
 Top 10 ASP.NET Sites 
.NET 247
Search Articles
Category:   Search Type:   Match Type:  
Access denied attempting to launch a DCOM Server.
Author: Saha, ProdipPosted: 9/30/2005 8:13:34 PM

Access denied attempting to launch a DCOM Server

You may have seen the following error message when you try to open the Excel application by using a non-interactive account (i.e. ASPNET, service account, etc.). A very typical scenario where an application worked fine all along when it was run under interactive user�s account during the development time. When you migrate the application to production environment, obviously, it has to run under a service account and you have discovered that the application cannot open the excel application there.

Access is denied.
Access denied attempting to launch a DCOM Server. The server is: {000C101C-0000-0000-C000-000000000046} The user is domain_name\service_account, SID=S-1-5-21-345165176-1234493503-2756780454-11115.

On your first guess, your may be thinking this is an ACL (Access Control List) permission issue and the account used to run the job or service does not have appropriate permissions on the network location. Well, that�s a possibility but one can easily verify if the service account has proper permissions on the target folder. After the verification you found that the account has the needed permissions but it is still receiving Access is denied message. So, what do you do to fix the problem?

A careful investigation will reveal more details. If you look at the event logs (System section) on the executing machine you will get to see more appropriate error message why the process failed. Access denied attempting to launch a DCOM Server. The server is: {000C101C-0000-0000-C000-000000000046}. Can you guess what�s the server they are talking about? It�s the class id associated with Interop.Excel.

By default non-interactive or service accounts are NOT granted permissions to either Access or Lunch Excel or Word or any other DCOM objects due to security reasons. However, you can overwrite the security settings on a particular DCOM object (i.e. Excel) if the application architecture or business requires you to do so.

Follow the steps below to configure the DCOM security settings on Microsoft Excel Application. The steps are documented for Windows XP operating system but the idea is same for other operating system. Only difference is- you just have to access DCOM Config utility differently:

  • 1. Go to Control Panel\Administrative Tools\Component Services.
  • 2. Component Services\Computers\My computer\DCOM Config
  • 3. You will probably get several message boxes asking about registered/unregistered components. Click yes on all of them.
  • 4. Go to Microsoft Excel Application. Right-click and click on Properties.
  • 5. Note the application id under the general tab for use later.
  • 6. Select the Security Tab
  • 7. Click customize under Launch Permissions. Click on Edit and Add the service(i.e. ASPNET) account to the Group or User names and click ok.
  • 8. Click customize under Access Permissions. Click on Edit and Add the service(i.e. ASPNET) account to the Group or User names and click ok.
  • 9. Click apply, then click ok.
  • 10. Now go to the application id key ({000C101C-0000-0000-C000-000000000046}) further down in the list and right-click and choose properties of that.
  • 11. Repeat numbers 6 through 9 for that application id.

The above configuration can be applied to all DCOM objects on the machine at once but it is never a recommended practice due to security reasons. Each application should be configured individually and it should be done on a case-by-case basis depending on the application security requirements.

If you are trying to run the Excel application from an ASP.NET application, this approach would be much better than using the local SYSTEM account to run the ASP.NET worker process. Simply grant the needed permissions to the account (by default machine_name\ASPNET for IIS5;  NT AUTHORITY\NETWORK SERVICE for IIS6) that is used to run the ASP.Net worker process (aspnet_wp.exe). If you are using Windows Integrated Authentication with Impersonation set to true, grant the permissions to the impersonated account.

Have a question or comment? Please visit Questions & Answers Forum 

Prodip K. Saha
The Architect of WWW.ASPNET4YOU.COM.

Terms and Conditions