473,398 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

SecurityException when trying to write to event log.

Dear all,
why do i get the following exception when i try to write to the event
log from a webform. and how can i resolve it?

Description:
The application attempted to perform an operation not allowed by the
security policy. To grant this application the required permission please
contact your system administrator or change the application's trust level in
the configuration file.

Exception Details: System.Security.SecurityException: Requested registry
access is not allowed.

i changed the trust level in my computer zone to full trust. but its still
the same, even though that this exception is thrown from a dll which is
referenced in the major project.

thank you for your help.
suhail
Nov 18 '05 #1
2 6264
"Suhail Salman" <su****@access2arabia.com> wrote in message
news:OV**************@tk2msftngp13.phx.gbl...
Dear all,
why do i get the following exception when i try to write to the event
log from a webform. and how can i resolve it?

Description:
The application attempted to perform an operation not allowed by the
security policy. To grant this application the required permission please
contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Requested registry
access is not allowed.

i changed the trust level in my computer zone to full trust. but its still
the same, even though that this exception is thrown from a dll which is
referenced in the major project.


This problem usually occurs when there is no event source defined. The first
write to the event source will try to create it. That's what you don't have
access to do.

Create the event source manually first. Look into the EventLogInstaller
class.
--
John Saunders
John.Saunders at SurfControl.com
Nov 18 '05 #2
The problem is that the aspnet account, by default, does not have the
security rights to create the event log application. You can manually
create this by editing the registry. Go to
HKLM\System\CurrentControlSet\Services\EventLog\Ap plication and add a node
underneath with the name of the application you are reporting in the event
log.

You can find the MS article on this problem here:
http://support.microsoft.com/default...Product=aspnet
Jeff

"John Saunders" <john.saunders at SurfControl.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
"Suhail Salman" <su****@access2arabia.com> wrote in message
news:OV**************@tk2msftngp13.phx.gbl...
Dear all,
why do i get the following exception when i try to write to the event log from a webform. and how can i resolve it?

Description:
The application attempted to perform an operation not allowed by the
security policy. To grant this application the required permission please contact your system administrator or change the application's trust level
in
the configuration file.

Exception Details: System.Security.SecurityException: Requested registry
access is not allowed.

i changed the trust level in my computer zone to full trust. but its
still the same, even though that this exception is thrown from a dll which is
referenced in the major project.


This problem usually occurs when there is no event source defined. The

first write to the event source will try to create it. That's what you don't have access to do.

Create the event source manually first. Look into the EventLogInstaller
class.
--
John Saunders
John.Saunders at SurfControl.com

Nov 18 '05 #3

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

Similar topics

2
by: Ray5531 | last post by:
I keep getting this error when my asp.net application tries to write into the registry System.Security.SecurityException: Requested registry access is not allowed. I followed the following...
5
by: Jarod_24 | last post by:
How do i prevent getting a System.Security.SecurityException when running my app from a Network Drive? My app stopped when checking for a previous instance of itself using the code: Private...
2
by: Jason | last post by:
I have written a VB app using the RS323.vb code from the VB resource kit. When I try to run the code from a network drive I get a securityexception error. If I copy the file to the local c drive...
0
by: Seok Bee | last post by:
Dear Experts, I've created a Console application to perform a checking of an Excel file. During development using vb.net in Visual Studio 2005, the application is running fine. I can get my...
3
by: Geoff McElhanon | last post by:
I have been struggling with a security issue that occurs under .NET 2.0, but does not occur under .NET 1.1. Essentially I am trying to open up a performance counter on a remote server and monitor...
0
by: Steve | last post by:
Hello- Platform: - web server using IIS 6 connecting to UNC share on separate file server - Both servers are Windows 2003 with dotNetFramework 2.0 General: - basic ASP.NET pages work fine...
4
by: =?iso-8859-1?q?Eir=EDkur_Fannar_Torfason?= | last post by:
I'm wrestling with a problem that I'm hoping someone can help me with. I have a web application written in VS.2003 and running on version 1.1 of the .NET Framework on XP pro and Windows server...
0
by: james | last post by:
Hi everyone, I am trying to lock down a server to only give permissions to certain assemblies, based on their strong name. I missed a couple and see SecurityExceptions on startup. Would anyone...
5
by: Henry Stock | last post by:
I am trying to understand the following error: Any thing you can tell me about this is appreciated. Security Exception Description: The application attempted to perform an operation not allowed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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...

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.