RE: "Requested registry access is not allowed." and performance counte



{\rtf1\ansi\ansicpg936\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\lang2052\f0\fs20 Hi Peter,
\par
\par Thank you for posting here.
\par
\par From your description, you're dynamically creating PerformanceCounter/Category in your ASP.NET webservice's code, however, you're euncountering smoe security exception against the registry accessing at runtime, correct?
\par
\par Based on my experience, there does exists some issues regarding on the ASP.NET idenitity doesn't have sufficient permission for accessing certain registry entry. For your scenario, your ASP.NET application is running on XP box, by default the ASP.NET process idenitity is the machine\\ASPNET account, however, I'm wondering whether you've used any other security related setting in IIS or ASP.NET such as impersonation which could change the default process idenitity of ASP.NET. You can verify this in your web application, and here is a kb article introduce the ASP.NET process identity:
\par
\par #Process and request identity in ASP.NET
\par http://support.microsoft.com/?id=317012
\par
\par Also, since the security exception is still complaining about the registry, I suggest you use the regmon tool to trace the registry accessing failure, this tool is very good at capturing reigstry access problem:
\par
\par http://www.sysinternals.com/utilities/regmon.html
\par
\par BTW, to help make the troubleshooting simplifed, I suggest you keep your ASP.NET application running as "Fulltrust" mode(this is the default mode if you haven't explicitly change the Trust level in your machine.config or web.config).
\par
\par Hope this helps.
\par
\par Regards,
\par
\par Steven Cheng
\par Microsoft MSDN Online Support Lead
\par
\par
\par ==================================================
\par
\par When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue.
\par
\par ==================================================
\par
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par
\par
\par Get Secure! www.microsoft.com/security
\par (This posting is provided "AS IS", with no warranties, and confers no rights.)
\par
\par
\par
\par
\par }

Relevant Pages