EventLog problem ,,Vista Home
-
Hi, I am tring to write in event log but i have security problem I have done some searchs but nothing usful for now VS 2008 AND VISTA Home String eventSource; eventSource = "TESTc"; EventLogPermission eventLogPermission = new EventLogPermission(EventLogPermissionAccess.Write, System.Environment.MachineName); System.Diagnostics.EventLog eLog = new System.Diagnostics.EventLog("Application", System.Environment.MachineName); eLog.Source = eventSource; eventLogPermission.PermitOnly(); eLog.WriteEntry("This test now", System.Diagnostics.EventLogEntryType.Information); ---------------------- Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Yes. CreatiVity withOuT limiTs
-
Hi, I am tring to write in event log but i have security problem I have done some searchs but nothing usful for now VS 2008 AND VISTA Home String eventSource; eventSource = "TESTc"; EventLogPermission eventLogPermission = new EventLogPermission(EventLogPermissionAccess.Write, System.Environment.MachineName); System.Diagnostics.EventLog eLog = new System.Diagnostics.EventLog("Application", System.Environment.MachineName); eLog.Source = eventSource; eventLogPermission.PermitOnly(); eLog.WriteEntry("This test now", System.Diagnostics.EventLogEntryType.Information); ---------------------- Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Yes. CreatiVity withOuT limiTs
This is Releated to Security Acees Persmission. are you facing the problem from local enviroment or after deployment of your application. if you deployed your application on IIS then you can face this problem becuase i think you are run your application on
Default Application Pool
. You just create your ownapplication pool
and Give theIdentity
tolocal System
that your application has the access to write on local system event viewer. then Asing this application pool to your web application !!! Hope this will resolve yopur problem !!!cheers, Abhijit Think Sharp | Code Sharp | C Sharp
-
This is Releated to Security Acees Persmission. are you facing the problem from local enviroment or after deployment of your application. if you deployed your application on IIS then you can face this problem becuase i think you are run your application on
Default Application Pool
. You just create your ownapplication pool
and Give theIdentity
tolocal System
that your application has the access to write on local system event viewer. then Asing this application pool to your web application !!! Hope this will resolve yopur problem !!!cheers, Abhijit Think Sharp | Code Sharp | C Sharp