Scott on Writing

Musings on technical writing...

Don't Forget to run the Install Services script after installing the Enterprise Library!

Since my first article on 4Guys covering the Enterprise Library - An Introduction to the Enterprise Library - one question I have received at least a dozen times is the following:

When running an Enterprise Library example on my computer I get the following exception:

System.Security.SecurityException: Requested registry access is not allowed

Failed to create instances of performance counter '# of Connection Failures/Sec' - The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.

Others have reported receiving this exception:

The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.

Line XXX: ds = db.ExecuteDataSet(dbCommandWrapper)

What the problem boils down to is that the performance counters used by the Enterprise Library have not been installed.  As discussed in Tom Hollander's blog entry Instrumentation in Enterprise Library:

One of the primary goals of Enterprise Library is to showcase best practices for enterprise .NET development. We try to do this in multiple domains, including architecture, code standards, unit testing and operations. ...  So instrumentation is very important, which is why we made sure we included it in the blocks - including event log messages, WMI events and performance counters. ... Instrumentation is enabled by default, but to make sure everything is registered you'll need to run the Install Services script from the Start Menu, or run installutil over each assembly (possibly as a part of your own MSIs). When you install Enterprise Library with default settings, all of the code will be automatically compiled, but unfortunately we didn't run the Install Services script for you. This was an unfortunate outcome - but if you remember to run the script yourself then everything should work well.

Essentially the Data Access Appliation Block (DAAB) portion of the Enterprise Library attempts to log instrumentation information to performance counters.  However, you must manually install these performance counters.  If you do not, one of the above exceptions will occur because the EntLib can't find the performance counter it wants to write to.

Hopefully Google picks up this blog entry so folks searching on the exception can quickly find a resolution.  I've also updated my two articles on 4Guys that cover the Enterprise Library - An Introduction to the Enterprise Library and Working with the Enterprise Library's Data Access Application Block (DAAB) - so that the text that discusses installing the services is red and bold.  Hopefully that will catch peoples' eyes!

One last comment about the Enterprise Library - there are some great webcasts and PowerPoint slides on the Enterprise Library over at http://www.pnplive.com/ - definitely worth checking out!

posted on Saturday, March 19, 2005 7:03 PM

Feedback

# OdeToCode Links For March 23 3/22/2005 9:37 PM OdeToCode Links

# OdeToCode Links For March 23 3/23/2005 10:44 AM OdeToCode Links

# re: Don't Forget to run the Install Services script after installing the Enterprise Library! 3/25/2005 6:23 AM Brendan Tompkins

I think Eric Wise posted a soltion to this that doesn't involve installation of VS.NET on the deployment machine

http://www.codebetter.com/blogs/eric.wise/archive/2005/03/21/60163.aspx

# re: Don't Forget to run the Install Services script after installing the Enterprise Library! 3/25/2005 1:43 PM ropadope

This is ridiculous. How many hours have been wasted on this problem when it should install by default.

Assinine.

# re: Don't Forget to run the Install Services script after installing the Enterprise Library! 4/5/2005 4:39 PM Johnny

I have one simple question regarding the Enterprise Library that I coul'ndt find the answer to.

Does the new Enterprise Library work with VS.NET 2005? I have been trying to install it several times now to play with it but it keeps failing when I "Build" the library.

BuildLibrary.bat fails with the following message: "Cannot find one or more components. Please re-install the application." Do you know if there is a workaround for this?

P.S - FYI, I do not have VS.NET 2003 on the machine.

Thanks!

Johnny

# re: Don't Forget to run the Install Services script after installing the Enterprise Library! 4/7/2005 7:27 AM Dave

Don't really like this, it should be off by default. What if your host doesn't allow the services to be run?
http://blogs.msdn.com/tomholl/archive/2005/02/18/376187.aspx?Pending=true
Shows how you can turn off the counters if needed

# Installing Enterprise Library on a server 4/13/2005 12:49 PM Keith Barrows - ASPInsider

I am going through the frustrations of installing the EntLib on a
server.  I will lay out the...

# Finally go this to work.... 4/29/2005 12:22 PM Diarmuid King

Thanks for the instructions above, these finally helped solve the error I was getting. There goes like 3 hours trying to solve this problem.

The DAAB is a nice tool but its implementation in this respect is totally flawed.

1. it shouldnt have external dependencies (on services etc installed on the box running it)

2. If it does have such dependencies they should be HIGHLIGHTED in the install instructions.

In most enterprise setups its almost impossible for application developers to get changes made to services running on production servers.

# re: Don't Forget to run the Install Services script after installing the Enterprise Library! 4/29/2005 12:26 PM Diarmuid King

Dam - posted in the wrong blog - it was turning off logging etc as described in tom hollanders blog (linked above) that did the trick for me.

The link I got the info at was:

http://blogs.msdn.com/tomholl/archive/2005/02/18/376187.aspx?Pending=true

and the error message I was getting was

System.Security.SecurityException: Requested registry access is not allowed

# re: Don't Forget to run the Install Services script after installing the Enterprise Library! 7/5/2005 6:17 PM Mohammad kabir

Didnt work. First of all, when I tried to install the Services Script it just flashed for a second. I am not sure if it installed properly.

# re: Don't Forget to run the Install Services script after installing the Enterprise Library! 10/24/2005 6:24 AM Mark Kamoski

Well, I ran the script as prescribed in the suggested article, "An Introduction to the Microsoft Enterprise Library" http://aspnet.4guysfromrolla.com/articles/022305-1.aspx , and all went well, I think.

To verify the install, I opened >Administrative Tools, >Perfomance, on my Windows XP Pro machine. Unfortnately, the view was not anything like the screenshot shown in the article.

As such, I am now wondering how to verify that this script ran OK.

Any ideas?

Please advise.

Thank you.

# re: Don't Forget to run the Install Services script after installing the Enterprise Library! 11/11/2005 4:26 AM Denny Smolinski

Correct me if I am wrong, but from all the information that I have read - you can not simply move the Enterprise Library DLLs into your project bin folder and compile that project and move those files to a production/hosted environment and expect it to work.

Let me know what you think about this statement.

Thank you.

# re: Don't Forget to run the Install Services script after installing the Enterprise Library! 6/8/2006 9:14 AM Luis Ugaz

We ran InstallUtil on all DLL, but the actual problem is with IIS and ASP.NET authentication.

We use integrated windows authentication and we get errors depending on what user logs on (but not consistently, which makes it a lot harder).

# 'System.Security.SecurityException: Requested registry access is not allowed.' when writing to event log 8/3/2006 12:40 AM Benny Ng (MiaoMiaoGa)

http://blogs.msdn.com/mohamed_sharafs_blog/archive/2005/09/18/470854.aspxhttp://geekswithblogs.net/t...

# MS Enterprise Library | keyongtech 1/21/2009 8:01 PM Pingback/TrackBack

MS Enterprise Library | keyongtech

Title:  
Name:  
Url:
Protected by Clearscreen.SharpHIPEnter the code you see:
Comments   

My Links

Ads Via DevMavens

Archives

Post Categories

 

I am a Microsoft MVP for ASP.NET.
I am an ASPInsider.
<March 2010>
SMTWTFS
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Comment Stats

DayTotal% of Total
Sunday 2056.8%
Monday 42514.1%
Tuesday 51917.2%
Wednesday 55518.4%
Thursday 58019.2%
Friday 54718.1%
Saturday 1886.2%
Total 3019100.0%

Hour1Total% of Total
12:00 AM 782.6%
1:00 AM 812.7%
2:00 AM 682.3%
3:00 AM 822.7%
4:00 AM 692.3%
5:00 AM 1264.2%
6:00 AM 1183.9%
7:00 AM 1816.0%
8:00 AM 1926.4%
9:00 AM 1585.2%
10:00 AM 1886.2%
11:00 AM 1936.4%
12:00 PM 2016.7%
1:00 PM 1846.1%
2:00 PM 1695.6%
3:00 PM 1354.5%
4:00 PM 1153.8%
5:00 PM 1073.5%
6:00 PM 1013.3%
7:00 PM 1073.5%
8:00 PM 923.0%
9:00 PM 882.9%
10:00 PM 913.0%
11:00 PM 953.1%
Total 3019100.0%

Comments by Blog Entry Date/Time

Day Entry MadeAvg.Total
Sunday 4.97159
Monday 4.80384
Tuesday 4.04477
Wednesday 7.39680
Thursday 6.26676
Friday 5.07466
Saturday 4.78177
Total 5.403019

Hour1 Entry MadeAvg.Total
12:00 AM 5.2937
1:00 AM 1.002
5:00 AM 0.000
7:00 AM 3.8550
8:00 AM 3.72134
9:00 AM 6.06297
10:00 AM 5.63276
11:00 AM 4.22194
12:00 PM 6.16351
1:00 PM 3.09133
2:00 PM 4.89230
3:00 PM 7.64321
4:00 PM 4.00108
5:00 PM 6.07170
6:00 PM 4.64116
7:00 PM 8.95188
8:00 PM 8.63164
9:00 PM 5.00115
10:00 PM 6.31101
11:00 PM 4.5732
Total 5.403019

Learn More About Comment Stats
1 - All times GMT -8...


Blog Stats

Favorite Web Sites

My Books

My MSDN Articles