![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum for Windows Vista help and discussion. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
|
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | security problem when writing to windows application log The following (vb.net code) works great on 2000 and XP but not on Vista: Dim ev As New EventLog("Application", System.Environment.MachineName, "MyProgramName") Dim LogText As String = "Hello world" Dim EntryType As System.Diagnostics.EventLogEntryType = EventLogEntryType.Information ev.WriteEntry(LogText, EntryType, LogEventID) ev.Close() The following excpetion is thrown on Vista: System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security. at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly) at System.Diagnostics.EventLog.SourceExists(String source, String machineName) at System.Diagnostics.EventLog.VerifyAndCreateSource(String sourceName, String currentMachineName) at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID) Any ideas on what extra is needed for Vista? Thanks in advance, Rob |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: security problem when writing to windows application log Did you try running this elevated (as elevated admininstrator) ? -- Regards, Yuriy This posting is provided "AS IS" with no warranties, and confers no rights. "Rob Latour" <roblatour@rogers.com> wrote in message news:%23UeHjqSkGHA.896@TK2MSFTNGP04.phx.gbl... > The following (vb.net code) works great on 2000 and XP but not on Vista: > > > Dim ev As New EventLog("Application", System.Environment.MachineName, > "MyProgramName") > > Dim LogText As String = "Hello world" > > Dim EntryType As System.Diagnostics.EventLogEntryType = > EventLogEntryType.Information > > ev.WriteEntry(LogText, EntryType, LogEventID) > > ev.Close() > > > > The following excpetion is thrown on Vista: > > > > System.Security.SecurityException: The source was not found, but some or > all event logs could not be searched. Inaccessible logs: Security. > at System.Diagnostics.EventLog.FindSourceRegistration(String source, > String machineName, Boolean readOnly) > at System.Diagnostics.EventLog.SourceExists(String source, String > machineName) > at System.Diagnostics.EventLog.VerifyAndCreateSource(String sourceName, > String currentMachineName) > at System.Diagnostics.EventLog.WriteEntry(String message, > EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) > at System.Diagnostics.EventLog.WriteEntry(String message, > EventLogEntryType type, Int32 eventID) > > > > Any ideas on what extra is needed for Vista? > > Thanks in advance, Rob > > |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: security problem when writing to windows application log Turns out I had to add an 'event log source'; this was not required in 2000 or xp but appears to be required in vista. thanks, Rob "Yuriy Shkolnikov [MSFT]" <yuriys@online.microsoft.com> wrote in message news:%23%23lS4LDlGHA.1320@TK2MSFTNGP04.phx.gbl... > Did you try running this elevated (as elevated admininstrator) ? > > -- > Regards, > Yuriy > > This posting is provided "AS IS" with no warranties, and confers no > rights. > "Rob Latour" <roblatour@rogers.com> wrote in message > news:%23UeHjqSkGHA.896@TK2MSFTNGP04.phx.gbl... >> The following (vb.net code) works great on 2000 and XP but not on Vista: >> >> >> Dim ev As New EventLog("Application", System.Environment.MachineName, >> "MyProgramName") >> >> Dim LogText As String = "Hello world" >> >> Dim EntryType As System.Diagnostics.EventLogEntryType = >> EventLogEntryType.Information >> >> ev.WriteEntry(LogText, EntryType, LogEventID) >> >> ev.Close() >> >> >> >> The following excpetion is thrown on Vista: >> >> >> >> System.Security.SecurityException: The source was not found, but some >> or >> all event logs could not be searched. Inaccessible logs: Security. >> at System.Diagnostics.EventLog.FindSourceRegistration(String source, >> String machineName, Boolean readOnly) >> at System.Diagnostics.EventLog.SourceExists(String source, String >> machineName) >> at System.Diagnostics.EventLog.VerifyAndCreateSource(String >> sourceName, >> String currentMachineName) >> at System.Diagnostics.EventLog.WriteEntry(String message, >> EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) >> at System.Diagnostics.EventLog.WriteEntry(String message, >> EventLogEntryType type, Int32 eventID) >> >> >> >> Any ideas on what extra is needed for Vista? >> >> Thanks in advance, Rob >> >> > > |
My System Specs![]() |
|
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem Writing file to CD | cjamps | .NET General | 1 | 08-18-2008 11:26 PM |
| writing problem | timmjann | Vista security | 2 | 10-29-2007 08:54 PM |
| Problem writing ID3 tags | Extracampine | Vista General | 8 | 02-24-2007 11:31 AM |
| Problem writing ID3 tags | Extracampine | Vista file management | 8 | 02-24-2007 11:31 AM |
| removing associated Norton files form windows security as it still appears in security centre after removing from registry, application common folders etc | Billy | Vista security | 1 | 02-04-2007 12:28 PM |
| Complimentary Industry Resources Vista Forums has joined forces with TradePub.com to offer you a new, exciting, and entirely free professional resource. Visit http://vistax64.tradepub.com today to browse our selection of complimentary Industry magazines, white papers, webinars, podcasts, and more across 34 industry sectors. No credit cards, coupons, or promo codes required. Try it today! |