Am I the only one to find this impossible to use? RRS feed

  • Question

  • User501551261 posted
    I love the Data Access Application block. Easy to configure, easy to use, makes my programming life easier. The Exception Management Application Block, however, is a nightmare to configure. I have now spent two hours, read through every post here, plus the microsoft article, and I'm still getting the security exception error. Am I missing something here? Isn't this supposed to make life easier?
    Monday, November 10, 2003 9:03 AM

All replies

  • User-1303368272 posted
    Most likely you are getting that error becaus the default configuration sends data to a specific event log source. If this event log source doesn't exist, it will try to go to the registry and create it, causing access denied. You can try creating the event source yourself, or granting access temporarily to asp.net, or similar.
    Monday, November 10, 2003 6:04 PM
  • User11897882 posted
    Well, I share your frustration Stephen! I inherited a web app from another developer who left the project and when I copied it down to my XP Pro SP2 box and immediately started getting the registry access errors. Here's what I did: 1. Installed the application block using the .MSI file supplied by MS 2. The previous developer wrapped the app block in his own class (but didn't extend it so don't ask me why) so I used the installutil.exe utility - that went perfectly. 3. Added FULL CONTROL access to the ASPNet user (just to test - I was frustrated!) to the 2 keys created by step 2 above. (HKLM\SYSTEM\CurrentControlSet\Services\Eventlog\Application\ExceptionManagerInternalException and HKLM\SYSTEM\CurrentControlSet\Services\Eventlog\Application\ExceptionManagerPublishedException) 4. Added a subkey of "EventMessageFile" to each of them and set the value to C:\\WINDOWS\\Microsoft.NET\\Framework\\v1.1.4322\\EventLogMessages.dll (which I read I needed to do in a post by Doug Seven) So I stopped getting the initial Registry access denied error (progress!) but I now get this error instead: [Win32Exception (0x80004005): Access is denied] [InvalidOperationException: Cannot open log for source {0}. You may not have write access.] System.Diagnostics.EventLog.OpenForWrite() System.Diagnostics.EventLog.WriteEvent(Int32 eventID, Int16 category, EventLogEntryType type, String[] strings, Byte[] rawData) System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category) System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID) System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type) xxx.SystemFramework.ExceptionManagement.DefaultPublisher.WriteToLog(String entry, EventLogEntryType type) in D:\Inetpub\wwwroot\MartianMethod\xxx\SystemFrameworksProjects\xxx.SystemFramework.ExceptionManagement\ExceptionManager.cs:647 5. Gave ASPNet write & modify access to all 3 .evt files in C:\WINDOWS\system32\config (SysEvent.evt, AppEvent.evt and SecEVent.evt) All this to no avail - I keep getting this *&%$ing error again and again! I have the XP firewall turned off BTW. One thing I did do some months ago is IIS Lockdown to secure my web server - could this have anything to do with it? I am now at the end of my tether - I have wasted two days on this and am little further ahead... and of course I have a huge deadline. I either need to sort this permissions problem out or change the output source to an XML or text file - but I can't see how to do that from the docs.... what did I miss? If anyone could help me I'd be really appreciative - I've searched every newsgroup 'til I'm blue in the face! TIA... Mike
    Wednesday, November 17, 2004 3:20 AM
  • User-1303368272 posted
    Try adding (A;;0x0002;;;AU) to your HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Eventlog\Application\CustomSD key in the registry. That will give authenticated users write access to the event log.
    Tuesday, November 30, 2004 5:58 PM
  • User11897882 posted
    Stephen, I believe that key is only relevant for WS2003 machines... on my XP SP2 machines the registry doesn't have a key called "CustomSD" in that path. I created one anyway and put that value in it so will test to see if it works - thanks for the tip, maybe that will do it! Mike
    Tuesday, November 30, 2004 6:40 PM
  • User-2113706185 posted
    I have the exact same problem. I've actually just disabled the code that throws the exception. That way the exception is written to the EventLog if it has the proper permissions (and nothing happens if it cannot access the eventlog). It's ok to set up permissions, when you control your server (like a development server), but in a production enviroment this is hard to control (especially in a shared hosted enviroment). /Rasmus
    Monday, February 21, 2005 3:59 AM
  • User865851310 posted
    Pre-Win2K3, the key is something like: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Log\RestrictGuestAccess Event Logging Security versus ... How to set event log security locally or by using Group Policy in Windows Server 2003
    Tuesday, March 8, 2005 1:57 PM
  • User11897882 posted
    I got sick of fighting it in the end and did what you did macrap - commented out the code to write the event log and now I write to my own text file using good old fashioned I/O functions. I think the exception management block is the most unweildy, over-hyped and verbose way to do error handling I've ever come across... useful for some projects I'm sure but total overkill for most others I suspect. I wasted so much time trying to get the stupid thing going I would never touch it again. Only my 2c.... ;) Mike
    Tuesday, March 8, 2005 4:46 PM
  • User-979712387 posted
    Hi, In doing a search of messages on this forum for 'ASPNET' is saw your message. I did the search after finding out that while ASPNET is the default user for asp.net applications under Win2k and XP, it's 'NETWORK SERVICE' under Win 2k Server in native mode with IIS 6 (default). As you say you loaded the application down to your XP box, I thought the user name change might be relevent to your problem (which is otherwise well over my head). I only got a simple test app to work by adding 'NT AUTHORITY\NETWORK SERVICE' as a SQL Server login. If it helps - great, otherwise just something to keep in mind.
    Sunday, March 13, 2005 3:33 PM
  • User11897882 posted
    Thanks Brian... I did eventually work that one out but only after a *lot* of wasted time and distributing multiple tufts of hair on the floor! IMO the entire MSDN docs on the EM block needs to be re-written making special note of how to set up the security for it - I have seen so many threads like this one on the web and in news groups and in all my searching (and I did a lot!) I did not find *one* reference on the MSDN site (or anywhere else for that matter) to setting up security/access etc for anything except WS2003... not acceptable when there are millions of developers and small businesses running web sites under XP Pro and IIS5.1. As I said though, I will never use it again... it's like cracking a nut with a sledgehammer for most of the sites I work on. It's also easier to open a text file (or delete it when it's too big) than muck about with the event manager which has an appalling interface and no real functionality. Thanks for taking the time to post though... I'm sure others will find it very useful when they are seriously considering doing harm to themselves while trying to get it to work! Mike.
    Sunday, March 13, 2005 6:08 PM