473,466 Members | 1,527 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Access to the registry key 'Global' is denied

Hi folks,

I've just got a new machine at work, so I've spent all day copying
across all of my work from my old machine. Now I've come across a
problem that I've never seen before.

I now get the following error when I attempt to run one of my sites:

"Access to the registry key 'Global' is denied"

Here's the stack trace for the error:

--- start ---
[UnauthorizedAccessException: Access to the registry key 'Global' is
denied.]
Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
+2116659
Microsoft.Win32.RegistryKey.InternalGetValue(Strin g name, Object
defaultValue, Boolean doNotExpand, Boolean checkSecurity) +2779573
Microsoft.Win32.RegistryKey.GetValue(String name) +29
System.Diagnostics.PerformanceMonitor.GetData(Stri ng item) +96
System.Diagnostics.PerformanceCounterLib.GetPerfor manceData(String
item) +147
System.Diagnostics.PerformanceCounterLib.get_Categ oryTable() +82
System.Diagnostics.PerformanceCounterLib.CounterEx ists(String
category, String counter, Boolean& categoryExists) +24
System.Diagnostics.PerformanceCounterLib.CounterEx ists(String
machine, String category, String counter) +90
System.Diagnostics.PerformanceCounter.Initialize() +720
System.Diagnostics.PerformanceCounter..ctor(String categoryName,
String counterName, String instanceName, Boolean readOnly) +110
System.Diagnostics.PerformanceCounter..ctor(String categoryName,
String counterName) +16
Opus2.Page.Admin.Page_Load(Object sender, EventArgs e) +37314
System.Web.Util.CalliHelper.EventArgFunctionCaller (IntPtr fp, Object
o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Cal lback(Object
sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+1061
---- end ----

I know what code is causing the problem, but I also know that it runs
fine on both my old machine and the live server where the same site is
running.

Have I missed something out when I set up the new machine, or is there
something I can do to allow ASP.NET access to the registry key it's
complaining about?

Cheers,

--
Dylan Parry - http://webpageworkshop.co.uk

A Flower?
Jul 17 '06 #1
3 18047
Dylan,

What is the account that ASP.NET is configured to run under? AFAIK, the
ASPNET local user doesn't have rights to access the registry by default.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dylan Parry" <us****@dylanparry.comwrote in message
news:ko*************@dylanparry.com...
Hi folks,

I've just got a new machine at work, so I've spent all day copying
across all of my work from my old machine. Now I've come across a
problem that I've never seen before.

I now get the following error when I attempt to run one of my sites:

"Access to the registry key 'Global' is denied"

Here's the stack trace for the error:

--- start ---
[UnauthorizedAccessException: Access to the registry key 'Global' is
denied.]
Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
+2116659
Microsoft.Win32.RegistryKey.InternalGetValue(Strin g name, Object
defaultValue, Boolean doNotExpand, Boolean checkSecurity) +2779573
Microsoft.Win32.RegistryKey.GetValue(String name) +29
System.Diagnostics.PerformanceMonitor.GetData(Stri ng item) +96
System.Diagnostics.PerformanceCounterLib.GetPerfor manceData(String
item) +147
System.Diagnostics.PerformanceCounterLib.get_Categ oryTable() +82
System.Diagnostics.PerformanceCounterLib.CounterEx ists(String
category, String counter, Boolean& categoryExists) +24
System.Diagnostics.PerformanceCounterLib.CounterEx ists(String
machine, String category, String counter) +90
System.Diagnostics.PerformanceCounter.Initialize() +720
System.Diagnostics.PerformanceCounter..ctor(String categoryName,
String counterName, String instanceName, Boolean readOnly) +110
System.Diagnostics.PerformanceCounter..ctor(String categoryName,
String counterName) +16
Opus2.Page.Admin.Page_Load(Object sender, EventArgs e) +37314
System.Web.Util.CalliHelper.EventArgFunctionCaller (IntPtr fp, Object
o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Cal lback(Object
sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+1061
---- end ----

I know what code is causing the problem, but I also know that it runs
fine on both my old machine and the live server where the same site is
running.

Have I missed something out when I set up the new machine, or is there
something I can do to allow ASP.NET access to the registry key it's
complaining about?

Cheers,

--
Dylan Parry - http://webpageworkshop.co.uk

A Flower?

Jul 17 '06 #2
Nicholas Paldino [.NET/C# MVP] wrote:

(OT: For some obscure reason I am unable to post to this group through
News.Individual.Net when I'm in the office. I can get headers, but not
post. Other groups are fine, and it works at home... Hence I'm using GG
for this reply)
What is the account that ASP.NET is configured to run under? AFAIK, the
ASPNET local user doesn't have rights to access the registry by default.
Yes, it's running under ASPNET, but then it was running under that same

user (without any extra privileges) on the live server and on my old
machine. I don't pretend to know enough to start fiddling with user
permissions for things like ASP.NET :s

The actual code that is causing the problem, and the lines I have
commented out temporarily to get the system up and running, are:

PerformanceCounter pc = new PerformanceCounter("System", "System Up

Time");
pc.NextValue();
TimeSpan ts = TimeSpan.FromSeconds(pc.NextValue());

I'm presuming that it's the first line causing the problem as that one
is getting a value from the registry?

--
Dylan Parry - http://electricfreedom.org

A Flower?

Jul 18 '06 #3
This has reminded me of a very similar issue I once had, same symptons just
a different area of functionality. I had written a web based dotnet
application that would log any errors in the event log. On my PC
everything ran without fail every time, however on the production server it
would fail trying to write to the registry at what appeared to be random
intervals. I started off really confused because I wasn't knowingly writing
to the registry. Similar to you, all user accounts were identical, only
difference appeared to be the two machines I was running it on. Turns out
that the crashes were caused by the production code attempting to log an
error with the event log. The "source" of events are stored in the
registry, if you try to use a "source" that has not yet been setup, then it
attempts to write that new "source" to the registry - which will fail
because the APSNET user doesn't have those rights. The difference in my
case, turns out that I'd developed the logging component in a windows
console, therefore using my NT account details, which had rights to update
the registry with the new "Source". Then on my box, when ever the web based
application wanted to log an error, it could quite happily use the existing
"source".

To get around the issue there was some sort of customer action that I had to
set up as part of the install process (i.e. under a proper NT account,
rather than the ASPNET user). I'm guessing the performance counter
parameters may also be stored in the registry in a similar fashion.

- Paul.
<us****@dylanparry.comwrote in message
news:11*********************@35g2000cwc.googlegrou ps.com...
Nicholas Paldino [.NET/C# MVP] wrote:

(OT: For some obscure reason I am unable to post to this group through
News.Individual.Net when I'm in the office. I can get headers, but not
post. Other groups are fine, and it works at home... Hence I'm using GG
for this reply)
>What is the account that ASP.NET is configured to run under? AFAIK, the
ASPNET local user doesn't have rights to access the registry by default.

Yes, it's running under ASPNET, but then it was running under that same

user (without any extra privileges) on the live server and on my old
machine. I don't pretend to know enough to start fiddling with user
permissions for things like ASP.NET :s

The actual code that is causing the problem, and the lines I have
commented out temporarily to get the system up and running, are:

PerformanceCounter pc = new PerformanceCounter("System", "System Up

Time");
pc.NextValue();
TimeSpan ts = TimeSpan.FromSeconds(pc.NextValue());

I'm presuming that it's the first line causing the problem as that one
is getting a value from the registry?

--
Dylan Parry - http://electricfreedom.org

A Flower?

Jul 18 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Kevin Swanson | last post by:
I'm attempting some remote registry manipulation via C#. I've written a test app to simply grab a specified key from a specified hive on a specified machine. The call to OpenSubKey is throwing...
12
by: Chad Crowder | last post by:
Hi all, I hope someone can give me a hand, because I'm out of ideas. I keep getting this message: Access to the path "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET...
1
by: Veeresh | last post by:
I am getting the following error message. I have logged into the system using my user name into the network. How to find out in which account ASP.Net is running?
0
by: Anton Sokolovsky | last post by:
Hello All, Please help. I am completely stuck. Any suggestions are very welcomed. I have ASP.NET application that impersonates certain user <impersonate="true" userName="registry:..."...
1
by: PiotrKolodziej | last post by:
Hi Here is the code: this.regPath = @"Software\FileManager\" ; System.Security.Permissions.RegistryPermission permissions = new...
8
by: Jeremy Ames | last post by:
I am trying to move an application from my system to a new test system. I really should have tried an easier program first, but I didn't really have a chance. My application was originally written in...
8
by: ajos | last post by:
hi frnds, im trying to convert my servlets database configuration from ms access to mysql database.however im getting some error like no driver found exception. to verify this error ive...
0
by: Andy | last post by:
Thanks Peter, I thought I'd give an update on this problem. My application had 2 assemblies that contained classed for the Data access and business logic layer. It was on one of them that I was...
5
by: rote | last post by:
I'm using ASP.NET 2.0 and i have copied and pasted the code below to my Global.asax file but it desn't trap the error I want to trap the 401 access denied void Application_Error(object sender,...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.