Click here to Skip to main content
15,888,096 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

Server Error in '/' Application.

Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

Source Error:

<pre> Line 415: //--------------------------------------------------------------------------------------------------- Line 416: <font color="red">Line 417: Excel.Application app = new Excel.Application(); </font>Line 418: Line 419: // create the workbook object by opening the excel file.</pre>

Source File: C:\inetpub\wwwroot\ITS Live\ITS\IntegratedTaxSystem\IntegratedTaxSystem\Handlers\IncomeTax\D03\DocumentUploadD03.ashx.cs    Line: 417

Stack Trace:

<pre> [UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).] System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType) +0 System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(RuntimeType serverType) +79 System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(RuntimeType serverType, Object[] props, Boolean bNewObj) +76 System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) +98 System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) +241 System.Activator.CreateInstance(Type type, Boolean nonPublic) +69 System.Activator.CreateInstance(Type type) +6 IntegratedTaxSystem.Handlers.IncomeTax.DocumentUploadD03.UploadForAnx13() in C:\inetpub\wwwroot\ITS Live\ITS\IntegratedTaxSystem\IntegratedTaxSystem\Handlers\IncomeTax\D03\DocumentUploadD03.ashx.cs:417 IntegratedTaxSystem.Handlers.IncomeTax.DocumentUploadD03.ProcessRequest(HttpContext context) in C:\inetpub\wwwroot\ITS Live\ITS\IntegratedTaxSystem\IntegratedTaxSystem\Handlers\IncomeTax\D03\DocumentUploadD03.ashx.cs:73 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75 </pre>


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1016















Posted
Comments
Maciej Los 9-Dec-13 16:57pm    
And the question is...

1 solution

SQL
Sometimes, you create new application pool and can’t solve it via DCOMCNFG. Then there is another method to do:
Set the Identity (Model Name) of application pool to Local System.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900