How to Test and Debug an ASP.NET Application—How to test an application from outside of Visual Studio
| Visual C# Tutorials |
| ASP.NET Tutorials |
|
© 2006 Mike Murach & Assoc. |
How to test an application from outside of Visual Studio
Once you’ve thoroughly tested and debugged an application from within Visual Studio, you’ll want to run it from outside of Visual Studio to make sure it works properly. Figure 4-7 describes how you do that.
To start, you open the browser you want to use. In this example, I used Mozilla Firefox. Then, you enter the URL for the starting page of the application and press Enter. When you do, a request for the page is sent to the server and the resulting page is displayed in the browser.
Note that to run a local IIS web site, you use “localhost” in the URL to identify the server. The URL in this figure, for example, refers to the Order.aspx page of the Ch03Cart web site. This web site is located in the ASPNET2005 directory of the local IIS server. In contrast, to run a remote IIS web site, you specify the actual server name in the URL like this:
http://mma1/ASPNET2005/Ch03Cart/Order.aspx
And to run an FTP web site, you enter the browse location like this:
http://Murach/Ch03Cart/Order.aspx
If you haven’t already tested an application from within Visual Studio in each browser that might be used to run the application, you should do that from outside Visual Studio. In addition, if the application retrieves and updates data in a database, you’ll want to test it simultaneously in two browser windows. To understand why, you need to realize that after an application retrieves data from a database, it closes the connection to the database. Because of that, two or more users can retrieve the same data at the same time. This is called concurrency, and it can cause concurrency errors when the data is updated.
In section 3 of this book, you’ll learn more about concurrency and how you avoid concurrency errors. For now, you should just realize that you’ll need to test your applications to be sure that they handle concurrency problems.
Figure 4-7 How to test an application from outside of Visual Studio
The Order page displayed in a Mozilla Firefox browser outside of Visual Studio
Description
• You can run any IIS application from outside of Visual Studio. To do that, open the browser you want to use, enter the URL for the starting page of the application as shown above, and press Enter.
• When you run an application from outside of Visual Studio, you can run it in two or more browser windows simultaneously. That way, you can be sure that the application provides for any concurrency errors that can occur.
• If you want to use the debugger while testing for concurrency errors, you can run one instance of the application from within Visual Studio with debugging, and you can run another instance from outside of Visual Studio.
|

