This project has moved and is read-only. For the latest updates, please go here.

Exception when selecting an "On An Event" trigger log source in Chinese

Aug 20, 2012 at 3:18 PM

OS: 64bit Win7 zh_CN
Build: 64bit EG

[Repro Steps]
1. EG > New a program/task
2. Go to Process Flow panel > 'Schedule' > Select 'Schedule project'
3. The 'Schedule' dialog opens
4. Click 'Trigger' tab > click 'New' button
5. 'New Trigger' dialog opens > select 'On An Event' from drop down list
6. Select 'Security' from log drop down list

See below for exception details:

Attempted to perform an unauthorized operation.

-------------------------- Technical Information Follows

Exception Details:
Exception type:  System.UnauthorizedAccessException
Message:         Attempted to perform an unauthorized operation.
Source:          System.Core
Target Site:     Throw

Stack Trace:
   at System.Diagnostics.Eventing.Reader.EventLogException.Throw(Int32
   at System.Diagnostics.Eventing.Reader.EventLogConfiguration..ctor(String
logName, EventLogSession session)
   at Microsoft.Win32.TaskScheduler.SystemEventEnumerator.GetEventSources(String
computerName, String log)
nged(Object sender, EventArgs e)
   at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
   at System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
   at System.Windows.Forms.ComboBox.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr
wparam, IntPtr lparam)

Aug 21, 2012 at 12:22 AM

I will add some error handling for this retrieval method. The error you are seeing comes from the fact that the process running your code does not have access to the Event Log on the computer you are connected to with the Task Scheduler.

Aug 22, 2012 at 6:47 PM

Thanks David!