Security problem with Exception Management Block

G

Guest

When running my application on accounts that don't have admin privileges, I
recieve the following error (I am trying to write to the Application event
log):

System.Security.SecurityException: The event source
ExceptionManagerInternalException does not exist and cannot be created with
the current permissions. ---> System.Security.SecurityException: Requested
registry access is not allowed.
at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
at System.Diagnostics.EventLog.CreateEventSource(String source, String
logName, String machineName, Boolean useMutex)
at System.Diagnostics.EventLog.CreateEventSource(String source, String
logName, String machineName)
at System.Diagnostics.EventLog.CreateEventSource(String source, String
logName)
at
Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.VerifyValidSource()
--- End of inner exception stack trace ---
at
Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.VerifyValidSource()
at
Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.Publish(Exception
exception, NameValueCollection additionalInfo, NameValueCollection
configSettings)
at
Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.PublishInternalException(Exception exception, NameValueCollection additionalInfo)
at
Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(Exception exception, NameValueCollection additionalInfo)
at
Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(Exception exception)
at FERC.DAMS.Common.ExceptionHandler.Publish(Exception ex)
at FERC.DAMS.UI.Windows.Controls.Screen.DamScreenCtl.Finish()
at FERC.DAMS.UI.Windows.Form.Form1.mnuFinish_Click(Object sender,
EventArgs e)
at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
at System.Windows.Forms.MenuItemData.Execute()
at System.Windows.Forms.Command.Invoke()
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)

What permissions do I need to give these accounts to make them work correctly?

Thanks,
Don Hurley
 
K

Kevin Yu [MSFT]

Hi Don,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you're trying to run an
application without administrator's privileges, you got an exception when
writing to event log. If there is any misunderstanding, please feel free to
let me know.

This exception is thrown because you don't have permission to write to or
create the certain registry keys. So please do the following for workaround.

To workaround this problem, you can grant permission to the user account
for full access to the following registry key.

HKLM\SYSTEM\CurrentControlSet\Services\Eventlog\<LogType>\<Source>.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top