KB 0022
Web application throws system exception when accessing system resources


CATEGORY

ASComm.NET

 

SYMPTOMS

When you run your web application, ASComm.NET throws a system exception:

System.Exception: ASComm.NET unable to access registry: Access to the registry key 'HKEY_LOCAL_MACHINE\Software' is denied. ASComm.NET uses a machine locked licensing mechanism that requires access to the registry and Windows directory.

 

CAUSE

By default, ASP.NET applications and Visual Studio do not run with adequate privileges to allow access to the registry and Windows directory.

 

RESOLUTION

To use ASComm.NET in ASP.NET web applications inside Visual Studio.NET, start Visual Studio using the 'Run As Administrator' option.

To run a program as an administrator, follow these steps:

  1. Right-click the icon that you use to run the program, and then click Run as administrator.
  2. When you are prompted for an administrator password or for a confirmation, type the administrator password, or click Continue.

If you must run a program as an administrator, you may want to set up the program so that you automatically run it as an administrator. To do this, follow these steps:

  1. Right-click the icon that you use to run the program, and then click Properties.
  2. On the Compatibility tab, click to select the Run this program as an administrator check box, and then click OK.

The Compatibility tab is not available for some program icons. For these program icons, follow these steps:

  1. Right-click the icon that you use to run the program, and then click Properties. On the Shortcut tab, the Target box contains the location and the name of the program file.
  2. Open the folder that contains the program file.
  3. Right-click the program file, and then click Properties.
  4. On the Compatibility tab, click to select the Run this program as an administrator check box, and then click OK.

To use ASComm.NET in ASP.NET web applications running on web server:

Click here to read MSDN Tech Note