ASP.NET
  Home arrow ASP.NET arrow Page 3 - How to Test and Debug an ASP.NET 2.0 Appli...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

How to Test and Debug an ASP.NET 2.0 Application
By: Murach Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 8
    2006-05-11

    Table of Contents:
  • How to Test and Debug an ASP.NET 2.0 Application
  • How to create a remote IIS web site
  • How to test an ASP.NET application
  • How to test an application with a browser other than the default
  • How to test a file-system web site with IIS

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    How to Test and Debug an ASP.NET 2.0 Application - How to test an ASP.NET application


    (Page 3 of 5 )



    To test an ASP.NET application, you typically start by running it from within Visual Studio so that you can locate and correct any errors you encounter. This initial testing uses the default browser and, if you’re working with a file-system web site, the ASP.NET Development Server. Next, you test the application with other web browsers to make sure it works with them, and you test a file-system web site under IIS. Finally, you run the application from outside of Visual Studio to be sure it will work correctly in a production environment.

    You’ll learn the techniques for performing all of these types of testing in the topics that follow. In addition, you’ll learn how to use the Exception Assistant dialog box that’s displayed if an error occurs while you’re testing an application.

    How to test an application with the default browser

    Unless you’ve changed it, Visual Studio uses Internet Explorer as its default browser. Figure 4-4 presents six different ways you can run a web application with the default browser. Three of these techniques start the debugger so you can use its features to debug any problems that might arise. The other three techniques do not start the debugger.

    The first time you run a web application using one of the first three techniques, Visual Studio displays a dialog box indicating that debugging isn’t enabled in the web.config file. From this dialog box, you can choose to add a new web.config file with debugging enabled, or you can choose to run the application without debugging. In most cases, you’ll add a new web.config file with debugging enabled so that you can use the debugger with your application.

    Before I go on, you should realize that before you can run an application with debugging on a remote server, a program called the Remote Debug Monitor must be installed and running on the server. For information on how to set up this program, see the help topic “How to: Set Up Remote Debugging.”

    All of the techniques listed in this figure except the View in Browser command start the application and display the application’s designated start page. However, the View in Browser command displays the selected page. For example, if you right-click the Cart page and choose View in Browser, the Cart page will be displayed. This command is most appropriate for making sure that the pages of an application look the way you want them to.

    At this point, you should realize that the type of web site you’re developing determines the web server that’s used to run the application. For example, if you’re developing a file-system web site, the ASP.NET Development Server is used to run the application. In that case, the URL for the page that’s displayed identifies the server as “localhost:” followed by a number that’s assigned by the development server. In contrast, if you’re developing an IIS web site, IIS is used to run the application. Then, the server is identified as just “localhost” for a local web site or by its actual name for a remote or FTP web site.

    The Order page displayed in the default browser


    Figure 4-4.  How to test an application with the default browser

    Three ways to run an application with debugging

    1. Click the Start Debugging button in the Standard toolbar
    2. Press F5
    3. Choose the Debug->Start command

    Three ways to run an application without debugging

    1. Press Ctrl+F5
    2. Choose Debug->Start Without Debugging
    3. Right-click a page in the Solution Explorer and choose View in Browser.

    Three ways to stop an application that’s run with debugging

    1. Press Shift+F5
    2. Click the Stop Debugging button in the Debug toolbar
    3. Choose Debug->Stop Debugging

    Description

    • If you run an application with debugging, you can use Visual Studio’s built-in debugger to find and correct program errors.
    • By default, an application is run using Internet Explorer. See figure 4-5 for information on using a different browser. To end the application, close the browser.

    You should also realize that you can’t just run an FTP application from its FTP location. That’s because this location is used only to transfer files to and from the server. Instead, a browse location must be set up for the web site. A browse location is simply an IIS virtual directory that points to the directory that stores the files for the web site. Then, to access and run the web site, you enter the HTTP URL for the virtual directory. The first time you run an FTP web site, you will be asked to enter this URL. Because the URL is stored as part of the web site, you won’t need to enter it again.

    More ASP.NET Articles
    More By Murach Publishing


       · This article is an excerpt from the book "Murach's ASP.NET 2.0 Web Programming with...
     

    Buy this book now. This article is excerpted from chapter four of the book Murach's ASP.NET 2.0 Web Programming with VB 2005, written by Joel Murach and Anne Boehm (Murach, 2006; ISBN: 1-890774-32-4). Buy this book now.

    ASP.NET ARTICLES

    - Adding Content to a Static ASP.NET Website
    - Building a Static ASP.NET Website in a Basic...
    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming
    - Introduction to the ADO.NET Entity Framework...
    - Completing an In-Text Advertising System und...
    - Programming an In-Text Advertising System un...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek