AnsweredAssumed Answered

System.Security.SecurityException

Question asked by cismapping on Jun 24, 2019

Hello All,

 

I ran into an unhandled exception that related to security on Windows 10.  Here are the exception that I captured.

 

Description:
  The source was not found, but some or all event logs could not be searched.  To create the source, you need permission to read all event logs to make sure that the new source name is unique.  Inaccessible logs: Security.
Error Type:
  System.Security.SecurityException
   at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly, Boolean wantToCreate)
   at System.Diagnostics.EventLog.SourceExists(String source, String machineName, Boolean wantToCreate)
   at System.Diagnostics.EventLogInternal.VerifyAndCreateSource(String sourceName, String currentMachineName)
   at System.Diagnostics.EventLogInternal.WriteEvent(EventInstance instance, Byte[] data, Object[] values)
   at System.Diagnostics.EventLog.WriteEvent(EventInstance instance, Object[] values)
   at System.Diagnostics.TraceInternal.TraceEvent(TraceEventType eventType, Int32 id, String format, Object[] args)
   at Esri.ArcGISRuntime.UI.Controls.GeoView.Esri.ArcGISRuntime.Internal.IDxSurfaceSource.OnDrawException(String intro, Exception ex)
   at Esri.ArcGISRuntime.UI.Controls.GeoView.<OnLoadedAsync>d__236.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Esri.ArcGISRuntime.UI.Controls.GeoView.<MapSurfaceElement_Loaded>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
When I run the application as administrator, it works.  The application is working after the first run as administrator.

 

We are using a Wpf application. The exception happened after page loaded event completed.

 

Please let me know why it is causing it.  I am using ArcGIS Runtime SDK for .NET version 100.5

 

Thanks,

 

Steven

Outcomes