473,320 Members | 2,024 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,320 software developers and data experts.

EventLogPermission

I am trying to read and/or write to the Event Log. I'm upgrading an
existing, working VS2003 VB.NET program to VS2005 and get the error message:

Request for the permission of type 'System.Diagnostics.EventLogPermission,
System, Version=2.0.0.0, Culture=neutral, PublickeyToken=b77a5c561934e089'
failed.

This occurs on the statement 'moEventlog = new Eventlog' in the VB.NET
program. I tried to fix the problem by adding the following lines
immediately before this line:

moEventLogPermission = new
EventLogPermission(EventLogPermissionAccess.Admini ster,".")
moEventLogPermission.Assert()

But this doesn't help at all - I get the exact same error message. Note: I
have 'Imports System.Diagnostics' so that's not the problem.

How can I get my event logging to work again? I know this is a new security
change with Dotnet Framework 2.0. Is there a simple fix?

Thanks,

Tom
Jun 22 '07 #1
0 1932

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

Similar topics

0
by: Henrik_the_boss | last post by:
Hello all. I have a couple of aspx pages. When something fails in them, I would like them to be able to log to either a database, a logfile, or the application log. All code is in C# I run...
6
by: Steve Teeples | last post by:
I have a piece of code (written is Visual Studio 2005) that is only reading the Security EventLog. On Windows XP Professiona/Home this code works just fine. int numberOfEntries =...
4
by: Mukesh | last post by:
Hi I m using microsoft application blocks Enterprise Library june 2005 with .net framework 1.1 and VStudio2003 And C# as coding language Sql server 2000 database the project is running...
3
by: Mukesh | last post by:
Thx Sloan for the solution. It is working properly under Full trust When i tried it under Medium trust it was giving error Parser Error Message: Required permissions cannot be acquired....
0
by: bthubbard | last post by:
Hello All, I've run into a bit of an issue and I was hoping that someone here could help me. I have inherited a Windows Service written in .Net 2.0 (C#) from a previous employee. It build...
1
by: bthubbard | last post by:
Hello All, I've run into a bit of an issue and I was hoping that someone here could help me. I have inherited a Windows Service written in .Net 2.0 (C#) from a previous employee. It build...
10
by: David Thielen | last post by:
Hi; I am trying to write to the event log using: public const string EVENT_LOG_NAME = "Windward Portal"; if (!EventLog.SourceExists(EVENT_LOG_NAME)) EventLog.CreateEventSource(EVENT_LOG_NAME,...
0
by: BLUE | last post by:
EventLogPermission permission = new EventLogPermission(EventLogPermissionAccess.Administer, "."); permission.PermitOnly(); If I use the above statements before CreateEventSource when I go to...
7
by: =?Utf-8?B?U3RldmVU?= | last post by:
I have a small app which tries reading the system, application, and security event logs within Vista. Many of the event logs return with a generic sentance indicating that: "The description for...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.