RAD Studio for Microsoft .NET |  |

Troubleshooting ASP.NET Applications
See Also
Collapse All

Unlike traditional window-based applications, web applications are dependent on servers and resources that are not directly within the control of the application or the user. Web applications are often hybrid combinations of client, server, and network resources.

The areas you need to check include ASP.NET installation, IIS installation and configuration, and security. All three of these areas are extensive and complex. The following procedures provide solutions to some of the most common problems.

Note: The following suggestions apply only to IIS 5.1.
To troubleshoot your ASP.NET application

1. Install or reinstall ASP.NET.
2. Create or check your ASP.NET user account.
3. Install or reinstall IIS.
4. Start or restart IIS.
5. Configure IIS to recognize your application.
6. Add document types to IIS.
7. Set anonymous authentication.
8. Check your database connection, if applicable.

To install or reinstall ASP.NET

1. Choose StartRun to display the Run dialog box.
2. Type cmd /e in the Open drop down list box.
3. Click OK.
4. Change directories to c:\Windows\Microsoft.NET\Framework\v1.1.4322.
5. Enter the command aspnet_regiis.exe -i.
6. Press Enter.
   Note: If you want to know the various command flags for the aspnet_regiis.exe
   utility, follow the basic command with a ? character instead of the -i flag.

To create or check your ASP.NET user account

1. Choose StartControl PanelUser Accounts to display the list of user accounts on your system.
2. If you do not have an ASPNET user account, create one.
3. Restart your machine.
   Warning: Do not give your ASPNET user administrator privileges. This opens up a security hole in your system and makes deployed ASP.NET applications vulnerable to hacking. Instead, create an impersonated user.

To install or reinstall IIS

1. Choose StartControl PanelAdd or Remove Programs. This displays the Add or Remove Programs dialog box.
2. Click Add/Remove Windows Components. This displays the Windows Components Wizard.
3. Check the Internet Information Services (IIS) check box.
4. Click Next.
5. Click Finish.
6. Start IIS.

To restart IIS

1. Choose StartControl PanelAdministrative ToolsInternet Information Services.
2. Select the local computer node.
3. Right-click and select Restart IIS.... This displays the Stop/Start/Reboot dialog.
4. Choose the task you want to accomplish from the drop down list box.
5. Click OK.

To configure IIS to recognize your application

1. In the IIS console, locate the folder or virtual directory containing your web application. If there is not a folder or virtual directory, you will need to create a virtual directory.
2. Select the folder.
3. Right-click and select Properties.
4. Click the Virtual Directory tab.
5. Under the Application Settings area, click the Create button. If the Remove button is displayed instead, you can remove, then create the virtual directory again, if necessary.

To add document types to IIS

1. Choose StartControl PanelAdministrative ToolsInternet Information Services.
2. Select Default Web Site.
3. Right-click and select Properties.
4. Click the Documents tab.
5. Click Add. This displays the Add Default Document dialog box.
6. Add WebForm1.aspx in the Default Document Name textbox.
7. Click OK twice.

To set anonymous authentication

1. In the IIS console, locate the folder or virtual directory containing your web application. If there is not a folder or virtual directory, you will need to create a virtual directory.
2. Select the folder.
3. Right-click and select Properties.
4. Click the Directory Security tab.
5. Click Edit.
6. Select the Anonymous Access check box.
7. In the User name: field, enter the name of the ASPNET user you created.
8. Check the Integrated Windows authentication check box or add your own password.
9. Click OK twice.

To check your database connection

1. Click the Data Explorer tab to display your database connections.
2. Expand the provider list to display a valid database connection.
3. Right-click and choose Modify Connection. This displays the Connections Editor.
4. If the Database connection string does not contain the localhost specifier, prepend it to the connection string, as in the following example:

Copy Code

    localhost:C:\Program Files\Common Files\Borland Shared\Data\EMPLOYEE.GDB

1. Make sure all of your other connection options are set property.
2. Click Test to make sure the connection is alive.

See Also

ASP.NET Overview

Microsoft Discussion Groups

Creating a Virtual Directory

Generating HTTP Messages in ASP.NET

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!