Click to See Complete Forum and Search --> : Unauthorized Access Error


Scott.Macmaster
May 21st, 2007, 08:57 AM
On my dev server all my pages work fine but on the live server they don't. Well, they all work except for the one option I have on one page. When I use it I get this error:


Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.
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.

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) 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.


Since the assemlies are listed under the windows directory I added ASPNET to the list of allowed users for it. That didn't help. Since the assemply I'm using reference a component in Microsoft Office I tried to add ASPNET to the list of users allowed to access the Microsft Office folder. That didn't work either. I don't really have any idea what to try next. Anyone have any ideals.?


Thanks,
Scott MacMaster

Scott.Macmaster
May 21st, 2007, 09:33 AM
I tried impersonating a local user account. The webpages work with that including the pages that access our SQL Server on the data server. However, the feature that gives the security error still won't work. It doesn't give an error message and just sits there and does nothing. After a while I clicked stop and tried other things. Another thing I tried is having it impersonate my network account. That got everything to work perfectly. However, aside from giving ASP.NET more access then it needs I really don't want my username and password in a text file. So the problem is a security restriction somewhere. I just can't figure out what the restriction is.

Any idea what?


Thanks,
Scott MacMaster

slickkick
July 25th, 2007, 02:35 PM
Are you using integrated windows authentication to authenticate with SQL server?

Scott.Macmaster
July 25th, 2007, 02:41 PM
Depends on which SQL Server I'm connecting to. In any case, I got it to work by including the following in web.config.

identity impersonate="true"/>