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...

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

Add To Your Reader

My Links

Archives

Post Categories

 

I am a Microsoft MVP for ASP.NET.
I am an ASPInsider.
<May 2008>
SMTWTFS
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

Comment Stats

DayTotal% of Total
Sunday 1866.8%
Monday 37913.9%
Tuesday 45316.7%
Wednesday 50418.5%
Thursday 53519.7%
Friday 49418.2%
Saturday 1666.1%
Total 2717100.0%

Hour1Total% of Total
12:00 AM 652.4%
1:00 AM 682.5%
2:00 AM 622.3%
3:00 AM 742.7%
4:00 AM 572.1%
5:00 AM 1033.8%
6:00 AM 1084.0%
7:00 AM 1585.8%
8:00 AM 1716.3%
9:00 AM 1475.4%
10:00 AM 1716.3%
11:00 AM 1816.7%
12:00 PM 1886.9%
1:00 PM 1696.2%
2:00 PM 1605.9%
3:00 PM 1324.9%
4:00 PM 1073.9%
5:00 PM 923.4%
6:00 PM 913.3%
7:00 PM 963.5%
8:00 PM 833.1%
9:00 PM 782.9%
10:00 PM 792.9%
11:00 PM 772.8%
Total 2717100.0%

Comments by Blog Entry Date/Time

Day Entry MadeAvg.Total
Sunday 5.54144
Monday 5.22339
Tuesday 4.28419
Wednesday 7.67637
Thursday 6.90607
Friday 5.48411
Saturday 5.33160
Total 5.842717

Hour1 Entry MadeAvg.Total
12:00 AM 5.0035
1:00 AM 1.002
5:00 AM 0.000
7:00 AM 7.0035
8:00 AM 5.35107
9:00 AM 6.32278
10:00 AM 6.47246
11:00 AM 4.41181
12:00 PM 6.88330
1:00 PM 3.00111
2:00 PM 5.41222
3:00 PM 8.64285
4:00 PM 4.0589
5:00 PM 5.92154
6:00 PM 4.52113
7:00 PM 9.67174
8:00 PM 9.80147
9:00 PM 5.05111
10:00 PM 5.4265
11:00 PM 4.5732
Total 5.842717

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


Blog Stats

Favorite Web Sites

My Books

My MSDN Articles