While working with Visual Studio or Visual Web Developer, we usually come across setting start up options, this article focuses on each of the start up options and explains their uses.
Start Options section let us setup the desired behavior of the web site or web application when it is debugged through Visual Studio or Visual Web Developer.
There are mainly three sections of the Start Options as shown the the picture below. There are few steps you need to follow to come to the Start Options.
Picture - 1
1. Go to Solution Explorer, right click Website project and click Property Pages as shown in the picture below.
2. Above step will give you Picture - 1, as shown above, click Start Options from the left site box and you will get Start Option dialogue box.
3. If your project is not a Website but it is a Web Application, right click the Web Application project in the solution explorer and click Properties. Click Web from left side tabs.
Get solutions of the .NET problems with video explanations, .pdf and source code in .NET How to's.
Once you are on the Start Options details dialogue box, you will have ability to setup different Start Options, lets see them one by one.
- Use current page: If you have selected first radio button, your current page will be assumed as the start page and when you hit F5 or click Debug menu > Start Debugging, whatever page is open currently in the Visual Studio or Visual Web Developer will be the first page (starting page) in the browser. For example, you have default.aspx, page1.aspx, page2.aspx and all pages are open in the Visual Studio, but you were working on page2.aspx, when you will hit F5, debugging will start from page2.aspx despite you have default.aspx (generally default.aspx page is considered as the start page if you have not specified any other page)
- Specific page: If you have selected second radio button, you need to specify a specific page you want to open when your debugging start. The specified page will open as the first page in the browser. You are free to specify any page irrespective of their file extensions. For example, you can specify *.aspx, *.htm, *.txt or whatever. This can also be done by right clicking the page (in the Solution Explorer) you want to specify as Start page and selecting Set As Start Page.
- Start external program: If you have selected third radio button, you can specify any external program that you want to open when your debugging start. Not relevant but you can specify C:\WINDOWS\system32\calc.exe and Windows calculator will start :). This also let you specify the command line arguments and working directory when your external program will open.
- Start URL: When you want a url to be the start page when you start your debugging, this option let you specify that. This is generally not used however in certain scenario, you might use this.
- Don't open a page, wait for a request from an external application: This option is equal to manually attaching debugger proccess from going to Debug menu > Add to process > select available proccess and attaching. This option will not open a page but the debugger will be attached and you are ready to debug your application. To do that you need to manually open the browser and hit the url (This option will automatically start the default web server that will appear in the bottom right corner of your monitor). For example, if your ASP.NET Development Server (in Visual Web Developer) starts on port 1369, you can hit http://localhost:1369/MyWeb/ assuming your project name was MyWeb. In Visual Studio, you can simply hit http://localhost/MyWeb and it should work if your IIS is setup in default mode.
- Use default web server: This option let Visual Studio or Visual Web Developer use the default web server avaialble on your computer. Visual Web Developer let you specify few more options like port, virtual path, using your local IIS Web Server instead of using its own Visual Studio Development server.
- Use custom server: This opiton let you specify any custom server you want to use when your debugging start.
- This changes based on what applications are installed on your system but ASP.NET option is common. If you have Silverlight project template and SQL Server project template also installed, you can see these options as well. This option let you attach these debuggers along with default asp.net debuggers so while debugging, you can debug asp.net, silverlight and others application pages at one go. In some scenaiors, you may not want all types of activitoes to be debugged, in that case you can uncheck a particular debugger for example Silverlight and focus on ASP.NET debugging only.
One more thing that is related with debugging is that if you have multilple projects in the Solution and you want a specific project to start when your debugger start, you can right click that project in the Solution Explorer and select Set as StartUp Project.
Hope this information will be useful for beginners. Thanks for reading. To get subsequent articles alert in your email directly, subscribe to the article feed.