I recently migrated a .NET application to a new server that I wrote 3 years ago and came across a couple of errors. Components of the application:
The following outlines three errors and their related resolutions. The first two are Enterprise Library related; the last one is specific to Oracle.
Error: Enterprise Library registry access is not allowed
enterprise library System.Security.SecurityException: Requested registry access is not allowed
- Open Regedt32
- Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog
- Right click EvenLog and add permissions:
- Network Services requires Full Permission
- Reboot the server
I'm not exactly sure how I came up with this solution since I had encountered it in the past and documented it in my notes.
Error: Enterprise Library performance counter must be initialized as ReadOnly.
Several application event errors are thrown if the Enterprise Library is not deployed to the server running the .NET application. Why you'd have to deploy the Enterprise Library on the server running the application is absurd. You should never have to do anything other than deploy your .dll's contained within your own application's bin folder. The error you'll likely see if you do not deploy the Enterprise Library on the server:
- Failed to create instances of performance counter 'Total Command Executions' - The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.
- Failed to create instances of performance counter 'Average Command Execution Time' - The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.
- Failed to create instances of performance counter '# of Commands Executed/Sec' - The requested Performance Counter is not a custom counter, it has to be initialized as Rea dOnly.
- Failed to create instances of performance counter 'Distributor: # of Logs Distributed/Sec' - The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.
Eric Wise has posted a solution that does not require you to deploy the entire Enterprise Library to your server. Rather, he came up with a script to only deploy the Enterprise Library dll's contained in your application.
For my records (and your use if you want), I'm attaching the relevant script:
I encourage you to visit Eric's blog and read up on the resolution he developed.
Oracle Error: System.Data.OracleClient requires Oracle client software version 8.1.7 or greater (Unrelated to the Enterprise Library)
As long as I'm documenting errors related to this particular .NET application, I may as well document an Oracle specific error
When using "System.Data.OracleClient" with the Oracle9i client to connect a .NET application to an Oracle database, the following error was thrown:
System.Data.OracleClient requires Oracle client software version 8.1.7 or greater
The cause and resolution is documented by Roy Tore Gurskevik. I'm copying the resolution in case his blog ever goes off-line as his last post was in May of 2006.
Security permissions were not properly set when the Oracle 9i Release 2 client was installed on Windows with NTFS. The result of this is that content of the ORACLE_HOME directory is not visible to Authenticated Users on the machine; this again causes an error while the System.Data.OracleClient is communicating with the Oracle Connectivity software from an ASP.NET using Authenticated User privileges.
To fix the problem you have to give the Authenticated Users group privilege to the Oracle Home directory.
- Log on to Windows as a user with Administrator privileges.
- Start Window Explorer and navigate to the ORACLE_HOME folder.
- Choose properties on the ORACLE_HOME folder.
- Click the "Security" tab of the "Properties" window.
- Click on "Authenticated Users" item in the "Name" list.
- Uncheck the "Read and Execute" box in the "Permissions" list under the "Allow" column.
- Re-check the "Read and Execute" box under the "Allow" column
- Click the "Advanced" button and in the "Permission Entries" verify that "Authenticated Users" are listed with permission = "Read & Execute", and Apply To = "This folder, subfolders and files". If not, edit that line and make sure that "Apply To" drop-down box is set to "This folder, subfolders and files". This should already be set properly but it is important that you verify it.
- Click the "Ok" button until you close out all of the security properties windows. The cursor may present the hour glass for a few seconds as it applies the permissions you just changed to all subfolders and files.
- Reboot, to assure that the changes have taken effect.