views:

805

answers:

4

I'm running windows 7 64-bit and iis7. I'm trying to setup a web application that was previously in iis6 on XP. It's giving me the error below. I've added the network service user to the Performance Monitor Users group to no avail.

Access to the registry key 'Global' is denied. 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: Access to the registry key 'Global' is denied.

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

A: 

Basically you need to follow the instructions, but look at the configuration of your Application Pool, you will want to find the executing user account, and grant that user access to the proper permissions.

Mitchel Sellers
My App Pool is using the "ApplicationPoolIdentity" user. The web service is trying to access the "Global" key in the registry. But that user does not have access to the registry. I'm trying to figure out how to give that user access? Or even just figure out what that user is?
fande455
+2  A: 

The problem is that user in Windows is known as DefaultAppPool. However he doesn't show up anywhere in the security dialogs. He is an actual user though. My problem was I needed that user to be part of the PerformanceMonitorUsers group because my web service was using PerformanceCounters. Turns out you have to do it from the command line.

net localgroup "Performance Monitor Users" DefaultAppPool /add

fande455
A: 

Thanks a lot Fande455. You are really genius.

Vivek Rathore
A: 

Worked fine for Windows7 but on Windows Server 2003 i am getting error "There is no such global user or group: DefaultAppPool." Please help!

Vivek Rathore
Windows Server 2003 runs IIS6, not IIS7 so you shouldn't even be having the problem mentioned above.
fande455