advertisement
Login | Register   
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Download the code for this article
Studying source code can be enlightening. Microsoft doesn't always make source code for its components available. Although the Cassini source code is in C#, do you have any interest in having it made available in VB.NET? Were you aware that you could obtain and modify the Cassini source? Do you have any additional ideas for extensions or modifications? Let us know in the csharp.general discussion group.
Partners & Affiliates
advertisement
advertisement
advertisement
advertisement
Average Rating: 1.7/5 | Rate this item | 36 users have rated this item.
Explore and Extend the Cassini Web Server (cont'd)
Debugging Cassini
The Cassini source and build script uses the command line C# compiler. As distributed it does not support using Visual Studio .NET solutions and projects to build and debug the code. The best option for debugging Cassini is to use the Attach Process feature in Visual Studio .NET.
advertisement


To debug your changes, first run the modified build script for the Cassini assemblies, which will create the executable application and the type library. Then run the CassiniWebServer.exe application. After it's running, open up Visual Studio .NET and select Debug Processes from the Tools menu. You'll see the Processes dialog shown in Figure 1. Select the CassiniWebServer.exe process, and then click the Attach button. Doing that adds the process to the list view in the lower portion of the window, and enables the Break, Detach, and Terminate buttons on the dialog. When you click the Break button, the debugger breaks into the selected process, letting you see the code that is currently being executed. From there you can set breakpoints in the code and inspect variables.

Figure 1: Visual Studio .NET enables you to easily attach to a process and debug it directly. When debugging .NET applications that have debug symbols supported through .pdb files, the debugging will enable you to view the source code for the application if it is available.
Note that with Cassini, the easiest way to debug the Web server is to set a breakpoint in the main executable and then step into the code for the Cassini.Server instance. For the example in this article you'll want to set a breakpoint in the Host.cs file on the private method OnSocketAccept(), since that's where you implemented the extended functionality for request logging.

As the sample application demonstrates, you can easily extend and modify Cassini to suit your individual needs. The ability to see and modify the source makes it a great platform for learning about ASP.NET and the development of internet application servers in general. In addition, Cassini's extensibility makes it an ideal choice for hosting your local client ASP.NET applications or for developing and testing ASP.NET applications.

Previous Page: Cassini Under the Hood  


Randy Holloway is the founder of Winformation Systems, a technology consulting and training initiative specializing in the development of enterprise systems in the Windows environment and Web services technologies. Randy speaks on technology-related topics and writes for publications including DevX.com and Visual Studio Magazine. Contact Randy .
Page 1: IntroductionPage 3: Debugging Cassini
Page 2: Cassini Under the Hood 
Please rate this item (5=best)
 1  2  3  4  5
advertisement