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

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" wrote in message
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
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]" wrote in message
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" wrote in message 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
Windows Vista
User login
Related topics
- Safe Mode Security Issue
- Aero
- Windows & Office For Consumers
- No flash
- Solution to Norton Unistall
- Turn off hibernate..?
- Get Windows 2000 Back.
- No mail showing up in client
- How to fix Master boot record damaged by Vista
- permission dialog box
- up date install
- Welcome to Windows Vista Administration, Accounts, and Passw
- Realtek Ac'97 Vista Beta2 fix?
- Internet connectivity via cable modem (again)
- Hauppauge
- UAC using 100% cpu
- How many weeks does it take to index files?
- No option of Vista on Booting
- Movie Maker
- Anti virus program
- Office 2003 Update
- link for beta sign up
- Why not have separate newsgroups for WLMD and Windows Mail?
- Readyboost only works on one usb slot
- The new UI is as ugly as hell
- Will I get RC1?
- Creating Vista Instilation disk
- Import WinXP Faxes
- Installing Vista on a non empty partition???
- Policy question
- Switching from XP to Vista Beta 2 Question?
- Can't delete Zone Alarm Pro So I can run PC-cillian
- Dual booting XP SP2 as default, not Vista
- Import password for news servers from OE
- Feedback
- WLMDb Feedback