Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

system.security.securityexception occured in mscorlib.dll 1

Status
Not open for further replies.

JawwadLone

Programmer
Mar 17, 2004
57
PK
Hi everyone,

I am using Microsoft Enterprise Library's data access block in my asp.net application. I am working on windows 2003 server. It works fine on windows 2000 and windows xp. But giving me this error

Code:
An unhandled exception of type 'System.Security.SecurityException' occured in mscorlib.dll. Additional infomation required. Requested registry access is not allowed

on following code

Code:
Try
    Dim ds As dataset
    Dim db As Oracle.OracleDatabase = DatabaseFactory.CreateDatabase
    Dim cmd_DISTRICT As Oracle.OracleCommandWrapper =  db.GetStoredProcCommandWrapper("DISTRICT_PKG.DISTRICTLookup")
    cmd_DISTRICT.AddInParameter("valueField", DbType.String, valueField)
    cmd_DISTRICT.AddInParameter("TextField", DbType.String, TextField)
    cmd_DISTRICT.AddInParameter("orderByField", DbType.String, orderByField)

    Return db.Executedataset(cmd_DISTRICT)
Catch ex As Exception
    return Nothing
End Try

can any one help me solve this problem. I would be very thankfull.

Regards,

Jawwad Lone.
 
I had similar error I manually added "Enterprise Library Instrumentation" key in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application

Restarted VS.NET it worked.

According to 4guysfromrolla Ent Library does not create performance counters. I suspect it has something to do with it.

 
Hi abcdHan123,

I have create the key in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application folder with the name "Enterprise Library Instrumentation" and restarted my application but still it is giving me same problem. Can you tell me if set anything or added something in "Enterprise Library Instrumentation" folder?

Regards,

Jawwad Lone.
 
Thanks abcdHan123 i got the solution following your instruction, I have added few more things to solve this problem

I have created two keys in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application folder
"Enterprise Library Instrumentation" and "Enterprise Library Data Service"

Plus I have created "EventMessageFile" value in both above mentioned folders with value "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\EventLogMessages.dll"


Thanks for help

Regards,

Jawwad Lone

 
Great Jawwad Lone,

Also read this from


Performance Counters
Check your event log and you will see a number of messages after your application executes Logger.Write. You will notice two error messages with a source of Enterprise Library Instrumentation. To fix this, you need to install the Logging performance counters - select All Programs\Microsoft p&p\Enterprise Library\Install Services. This will execute installutil on each of the assemblies and install all of the performance counters and WMI events. Each block includes a basic set of instrumentation counters that can be used to monitor the block

Another good resource for enterprise library is

Hope That helps
-Reddy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top