Wrox Programmer Forums
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 24th, 2004, 06:47 AM
Authorized User
Join Date: Oct 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default my problem with the LogEvent

I used windows2003, vs2003 and sql2000, I have changed the "machine" into "system" in the Machine.Config file, the sever is my own machine so i have all the permissions i need but i run the code with the trouble as described below, please help me.

Security Exception
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.

Source Error:

Line 29: if (!EventLog.SourceExists("ThePhile.COM"))
Line 30: {
Line 31: EventLog.CreateEventSource("ThePhile.COM", "Application");Line 32: }
Line 33: EventLog.WriteEntry("ThePhile.COM", message, entryType);

Source File: d:\studytemp\wrox\thephile\PhilePage.cs Line: 31
Old October 24th, 2004, 07:23 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Hi there,

Your account may have enough permissions, but the account that ASP.NET uses doesn't.

Generally, it's no longer recommended to create the Event Log at run-time for security reasons. This used to be possible in early betas of .NET but it's no longer possible by default.

Check out the following links for more info about this, and for tips about creating the log at deployment time:



Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Just A Test by Beastie Boys (Track 5 from the album: Hello Nasty) What's This?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Source name in LogEvent startfish VBScript 6 January 12th, 2011 02:46 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.