Exception Management Application Block Question

  • Thread starter Thread starter PCC
  • Start date Start date
P

PCC

I am using the Exception Managment Application Block on Windows Server 2003
Enterprise and .NET v1.1.

If I use the block with an ASP.NET web wervice or in a web application I get
the following error:

------------------------------------

System.Security.SecurityException: The event source
ExceptionManagerInternalException does not exist and cannot be created with
the current permissions. ---> System.Security.SecurityException: Requested
registry access is not allowed.
at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
at System.Diagnostics.EventLog.CreateEventSource(String source, String
logName, String machineName, Boolean useMutex)
at System.Diagnostics.EventLog.CreateEventSource(String source, String
logName, String machineName)
at System.Diagnostics.EventLog.CreateEventSource(String source, String
logName)
at
Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.VerifyValid
Source() in D:\Program Files\Microsoft Application Blocks for .NET\Exception
Management\Code\CS\Microsoft.ApplicationBlocks.ExceptionManagement\Exception
Manager.cs:line 661
--- End of inner exception stack trace ---
at
Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.VerifyValid
Source() in D:\Program Files\Microsoft Application Blocks for .NET\Exception
Management\Code\CS\Microsoft.ApplicationBlocks.ExceptionManagement\Exception
Manager.cs:line 666
at
Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.Publish(Exc
eption exception, NameValueCollection additionalInfo, NameValueCollection
configSettings) in D:\Program Files\Microsoft Application Blocks for
..NET\Exception
Management\Code\CS\Microsoft.ApplicationBlocks.ExceptionManagement\Exception
Manager.cs:line 535
at
Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.PublishInte
rnalException(Exception exception, NameValueCollection additionalInfo) in
D:\Program Files\Microsoft Application Blocks for .NET\Exception
Management\Code\CS\Microsoft.ApplicationBlocks.ExceptionManagement\Exception
Manager.cs:line 301
at
Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(Exc
eption exception, NameValueCollection additionalInfo) in D:\Program
Files\Microsoft Application Blocks for .NET\Exception
Management\Code\CS\Microsoft.ApplicationBlocks.ExceptionManagement\Exception
Manager.cs:line 229
at
Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(Exc
eption exception) in D:\Program Files\Microsoft Application Blocks for
..NET\Exception
Management\Code\CS\Microsoft.ApplicationBlocks.ExceptionManagement\Exception
Manager.cs:line 66
at AuctionChannel.Service1.GetDataSet(String QueryName) in
C:\Inetpub\wwwroot\AuctionChannelBO

------------------------------------

I think this is a permissions issue with the ASP user, but I do not want to
change the ASP permissions (for other security reasons). Does anyone know
another way aroud this issue? Any pointers, links, samples, etc. would be
appreciated. Thank you.
 
PCC,

If you don't want to change the ASPNET user permissions, then you can
change the permissions on the registry key that it is trying to access so
that the ASPNET user has access to it.

Hope this helps.
 
Thanks Nicholas, I swear you are always the first to answer any questions I
post in these newsgroups!

This never seemed to be an issue with .NET 1.0 and Windows 2000 Server. I
am a little hesitant to grant permissions to the ASPNET user if there was
another way around the problem. If nobody else comes up with a work around,
I will grant the ASPNET user the needed permissions. Thanks.


Nicholas Paldino said:
PCC,

If you don't want to change the ASPNET user permissions, then you can
change the permissions on the registry key that it is trying to access so
that the ASPNET user has access to it.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

PCC said:
I am using the Exception Managment Application Block on Windows Server 2003
Enterprise and .NET v1.1.

If I use the block with an ASP.NET web wervice or in a web application I get
the following error:

------------------------------------

System.Security.SecurityException: The event source
ExceptionManagerInternalException does not exist and cannot be created with
the current permissions. ---> System.Security.SecurityException: Requested
registry access is not allowed.
at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
at System.Diagnostics.EventLog.CreateEventSource(String source, String
logName, String machineName, Boolean useMutex)
at System.Diagnostics.EventLog.CreateEventSource(String source, String
logName, String machineName)
at System.Diagnostics.EventLog.CreateEventSource(String source, String
logName)
at
Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.VerifyValid
Source() in D:\Program Files\Microsoft Application Blocks for .NET\Exception
Management\Code\CS\Microsoft.ApplicationBlocks.ExceptionManagement\Exception
Manager.cs:line 661
--- End of inner exception stack trace ---
at
Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.VerifyValid
Source() in D:\Program Files\Microsoft Application Blocks for .NET\Exception
Management\Code\CS\Microsoft.ApplicationBlocks.ExceptionManagement\Exception
Manager.cs:line 666
at
Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.Publish(Exc
eption exception, NameValueCollection additionalInfo, NameValueCollection
configSettings) in D:\Program Files\Microsoft Application Blocks for
.NET\Exception
Management\Code\CS\Microsoft.ApplicationBlocks.ExceptionManagement\Exception
Manager.cs:line 535
at
Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.PublishInte
rnalException(Exception exception, NameValueCollection additionalInfo) in
D:\Program Files\Microsoft Application Blocks for .NET\Exception
Management\Code\CS\Microsoft.ApplicationBlocks.ExceptionManagement\Exception
Manager.cs:line 301
at
Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(Exc
eption exception, NameValueCollection additionalInfo) in D:\Program
Files\Microsoft Application Blocks for .NET\Exception
Management\Code\CS\Microsoft.ApplicationBlocks.ExceptionManagement\Exception
Manager.cs:line 229
at
Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(Exc
eption exception) in D:\Program Files\Microsoft Application Blocks for
.NET\Exception
Management\Code\CS\Microsoft.ApplicationBlocks.ExceptionManagement\Exception
Manager.cs:line 66
at AuctionChannel.Service1.GetDataSet(String QueryName) in
C:\Inetpub\wwwroot\AuctionChannelBO

------------------------------------

I think this is a permissions issue with the ASP user, but I do not want to
change the ASP permissions (for other security reasons). Does anyone know
another way aroud this issue? Any pointers, links, samples, etc. would be
appreciated. Thank you.
 
Nick Wienholt said:
Run installutil against the exception management block assembly - this
creates the event source.

Nick Wienholt, MVP
Maximizing .NET Performance
http://www.apress.com/book/bookDisplay.html?bID=217
Sydney Deep .NET User Group www.sdnug.org


Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.VerifyValid
Management\Code\CS\Microsoft.ApplicationBlocks.ExceptionManagement\Exception
Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.VerifyValid
Management\Code\CS\Microsoft.ApplicationBlocks.ExceptionManagement\Exception
Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.Publish(Exc
Management\Code\CS\Microsoft.ApplicationBlocks.ExceptionManagement\Exception
Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.PublishInte
Management\Code\CS\Microsoft.ApplicationBlocks.ExceptionManagement\Exception
Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(Exc
Management\Code\CS\Microsoft.ApplicationBlocks.ExceptionManagement\Exception
Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(Exc
Management\Code\CS\Microsoft.ApplicationBlocks.ExceptionManagement\Exception
 
ExceptionManagerInternalException

I don't know against what run the installutil. Could someone write a more specific example about how can I do this? I found that you should run this against an exe file but I don't have an exe because I'm programming a Web Solution.

In advance thank you for your advice.
 
Last edited:
To fix the error:" The event source
ExceptionManagerInternalException does not exist and cannot be created with
the current permissions.", do this:


  1. Open regedt32 (not the standard, regedit) and navigate to: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\EventLog
  2. click on "Security-->Permissions..." in the menu.
  3. Add the ASPNET account for the local machine and place a check next to "Full Control".
Restart the machine and click on 'Yes' to accept the cahnges when machine is re-booted.

Hope that works for you,
Umer
 
Back
Top