IF YOU ARE DEVELOPING A PROJECT IN CCS 3.0 (IN DOTNET 1.1 OR 2.0 ENVIRONMENT) AND EVER COME WITH A PROBLEM/ERROR (MENTIONED BELOW) WHILE RUNNING THE LIVE PAGE ON THE BROWSER, PLEASE FOLLOW THE SOLUTION WHICH IS AT THE BOTTOM OF THE POST.
MY DEVELOPMENT ENVIRONMENT IS
WINDOWS XP SP2 MEDIA CENTER PC (DUAL CORE PROCESSOR)
SQL 2000
CCS 3.0
ASP.NET APPLICATION
I WAS GETTING THE FOLLOWING ERROR WHILE RUNNING THE LIVE PAGE ON THE BROWSER.
Server Error in '/applicationname' Application.
--------------------------------------------------------------------------------
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Requested registry access is not allowed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SecurityException: Requested registry access is not allowed.]
Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +473
System.Data.Common.ADP.ClassesRootRegistryValue(String subkey, String queryvalue) +219
System.Data.OleDb.OleDbConnectionString.ValidateParse() +371
System.Data.Common.DBConnectionString..ctor(String connectionString, UdlSupport checkForUdl) +144
System.Data.OleDb.OleDbConnectionString.ParseString(String connectionString) +98
System.Data.OleDb.OleDbConnection.set_ConnectionString(String value) +11
System.Data.OleDb.OleDbConnection..ctor(String connectionString) +159
applicationname.Data.OleDbDao..ctor(ConnectionString connection) +195
applicationname.Configuration.Settings.get_dbconnectionNAMEDataAccessObject() +46
applicationname.pagename.tblNamesDataProvider..ctor() +447
applicationname.pagename.pagenamePage.OnInit(EventArgs e) +397
System.Web.UI.Control.InitRecursive(Control namingContainer) +240
System.Web.UI.Page.ProcessRequestMain() +2112
System.Web.UI.Page.ProcessRequest() +218
System.Web.UI.Page.ProcessRequest(HttpContext context) +18
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
I TRIED EVERYTHING, CHANGED THE PERMISSIONS ON REGISTRY SETTINGS, UNINSTALLED DOTNET FRAMEWORK, REINSTALLED DOTNET FRAMEWORK, TRIED MS KB ARTICLE 329291, RESEARCHED ON THE TECHNET, MSDN, GOOGLE, GAVE ADMINISTRATOR PERMISSIONS TO ASPNET ACCOUNT ETC ETC -- NO LUCK!!!
WELL FINALLY BEFORE TURNING THE COMPUTER OFF, I GAVE A LAST TRY AND BINGO!!! IT WORKED!!!
SOLUTION IS AS FOLLOW (THIS SOLUTION IS FOR DEVELOPMENT ENVIRONMENT ONLY):
1. Give the ASPNET user permission to read the Security eventlog registry entry.
Run regedt32
Navigate to the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security
Right click on this entry and select Permissions
Add the ASPNET user
Give it Read permission
2. Change settings in machine.config file
Run Explorer
Navigate to WINDOWS or WINNT folder
Open Microsoft.NET folder
Open Framework folder
Open v1.1.4322 folder (folder name may be different, depending on what dotnet version is installed)
Open CONFIG folder
Open machine.config file using notepad (make a backup of this file first)
Locate processmodel tag (approx. at line 441)
Locate userName="machine" (approx. at line 452)
Change it to userName="SYSTEM"
Save and close the file
Close Explorer
3. Restart IIS
Run IISReset
THAT'S IT. HAPPY PROGRAMMING...