locked
Security Exception in Exception Manager App Block RRS feed

  • Question

  • User-860949210 posted
    Hi, I'm attempting to get MS's App Block to work in my app but when I Publish an exception with default settings a security exception is raised: System.Security.SecurityException: Requested registry access is not allowed. The error occurs when executing the following method VerifyValidSource, on he line "if (!EventLog.CreateEventSource(applicationName, logName): private void VerifyValidSource() { try { if (!EventLog.SourceExists(applicationName)) { EventLog.CreateEventSource(applicationName, logName); } } catch(SecurityException e) { throw new SecurityException(String.Format(resourceManager.GetString("RES_DEFAULTPUBLISHER_EVENTLOG_DENIED"), applicationName),e); } } Has anybody come across this before when using this particular Application Block?
    Thursday, July 3, 2003 10:13 AM

All replies

  • User-311644740 posted
    Yeah, I have the same problem. Not sure how to set the permissions.
    Tuesday, July 15, 2003 9:17 PM
  • User-1303368272 posted
    This will occur if you are using the Event Log publisher and have not registered the event source you are using in the registry. It will try to register the event source automatically and then you'll get this permission error if it doesn't have the rights to create the key. You can either add it manually or set the correct permissions.
    Wednesday, July 16, 2003 4:06 PM
  • User76536425 posted
    The problem, as other posters have implied, is that you don't have runtime permissions to read or write to the registry. The solution is to create a custom installer that sets everything up when you install your app. Since you have to have admin priviledges to install an app, you can set it up then. There's an example of a custom installer within the EMAB itself, so you can copy what it's doing. Don
    Wednesday, July 16, 2003 11:25 PM
  • User211482755 posted
    Were you able to solve the problem? I am having exactly same problem and need some help. Can you tell me how to create custom installer or set the permissions. -Neeraj
    Wednesday, October 1, 2003 1:59 AM
  • User76536425 posted
    Hi Neeraj, Check this out: <post>347696</post>. It talks about the issue and where to find info. Don
    Thursday, October 2, 2003 11:55 AM
  • User-1709111988 posted
    I am having the same challenges. I followed the above referenced post, looked at http://support.microsoft.com/default.aspx?scid=kb;en-us;329291 and did everything per the directions. I still get the error. (I am an admin on my machine)
    Tuesday, November 4, 2003 3:55 PM
  • User-549090290 posted
    not sure if this will help but i've never used the eventlog as it is one of those places that can 'wrap around itself'. I've always got mine to work as I placed the results in a text file on the filesystem XML /or raw text. The publishers that come with MAB already cater for the above there are also other good reasons for not using the event log...more on that another time warmly pak
    Thursday, December 4, 2003 9:46 AM
  • User1143314076 posted
    Yes, i also had same kind of problem. The reason for the problem is, by default ASPNET user doesn't have permission to accessing registry. So there is only one way is to increase the permission role (by default its role is user). If u don't require to increase level permission of ASPNET user. Better create a user with power user role and add this code in ur asp.net application web.config file <system.web> <identity impersonate="true" userName="VasaSample" password="vasa@2" /> ... </system.web>
    Tuesday, June 8, 2004 7:52 AM