Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. EventLog problem ,,Vista Home

EventLog problem ,,Vista Home

Scheduled Pinned Locked Moved ASP.NET
workspacevisual-studiosecurityhelpannouncement
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Amr M K
    wrote on last edited by
    #1

    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

    A 1 Reply Last reply
    0
    • A Amr M K

      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

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      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 own application pool and Give the Identity to local 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

      A 1 Reply Last reply
      0
      • A Abhijit Jana

        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 own application pool and Give the Identity to local 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

        A Offline
        A Offline
        Amr M K
        wrote on last edited by
        #3

        yes its work but I have problem when creating event Source

        Yes. CreatiVity withOuT limiTs

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups