Page 274 - DCAP312_WEB_TECHNOLOGIES_II
P. 274

Web Technologies-II



                   Notes         Download Cassini++ from the link provided and extract the files to a directory on the same
                                 machine that we are running Sharp Develop on.
                                 14.1.3 Debugging an ASP.NET Application
                                 First let us set a breakpoint in our application. Find the Default.aspx.cs file in our project and
                                 open it in the text editor. Locate the Page Load method and set a breakpoint inside this method
                                 on the Response.Write line (See Figure 14.2).

                                                   Figure 14.2: Debugging an ASP.NET Application
























                                 Now we need to configure the project to run Cassini when we debug our application. From
                                 the Project menu select Project Options. In the options dialog select the Debug tab. Set the Start
                                 Action to Start external program and enter the path to the Cassini executable. In the Start Options
                                 enter the command line that will be passed to Cassini. The Cassini command line is of the form:
                                 <Physical-path> <port> <virtual-path>

                                 In the Figure 14.3 we can see an example command line passed to Cassini. In this case Cassini
                                 will listen for requests on port 8080, the virtual path will be set to “/” and the physical path to
                                 our project is specified by a using SharpDevelop property ${ProjectDir} which will be replaced
                                 when we start debugging. We can put the full path to our project directory here instead of using
                                 the ProjectDir property.

                                                    Figure 14.3: Command Line Passed to Cassini
























        268                               LOVELY PROFESSIONAL UNIVERSITY
   269   270   271   272   273   274   275   276   277   278   279