In ASP.NET 2.0, you have multiple options to take your application offline.
- By setting httpruntime to false in web.config. For example,
- Using ASP.NET Configuration Site. In this configuration site, you have option to take your application offline in “Application Configuration” tab. This tab also shows whether your application is currently offline or online. Internally this configuration uses the first option to shutdown the application i.e by setting httpruntime to false. To know more about ASP.NET Configuration. Check out this article.
- Third option is by creating an empty htm page named app_offline.htm in your root directory. If this htm page contains any content, then that content is displayed instead of 404 error.
Advantages of all these options are, it doesn’t shutdown the whole process in which your web application is running. It just shuts down the appdomain of your web application. Hence other applications which runs along with your application in the process runs without any problem. These options can be used when you are doing maintenance on your site.
Note: If you web application gives 404 error, then check whether any one of this options is enabled. Actually, copy web site in ASP.NET 2.0 internally uses app_offline approach and sometime it leaves that file in the root directory. When you access your site after copy web site operation, you might get offline message. Then check out for this dummy page and remove it.
When you access Source Control Explorer in VS.NET 2005 Beta2, sometimes you might the following error.
Exception has been thrown by the target of an invocation.
You might be wondering why this error occurs and it wont occur always. This error comes only when you try to open Source Control Explorer without connecting to TFS. To avoid this problem, always activate team explorer window (internally it will connect to TFS) and then access Source Control Explorer.
Actually, Source Control Explorer should automatically connect to TFS when we open Source Control Explorer. Probably in the beta3 (which is supposed to be released along with VS.NET 2005 RTM) it might work that way.
In whidbey, ASP.NET Project Start option has come up with additional option "Use Current Page". When you set this option and run/debug your project, VS.NET will start with the current aspx page that you are working on. If you are working on codebehind file, it will open the corresponding aspx page.
To go to Start option: Select Web Project --> Choose Property Pages option [shortcut Alt-Enter] --> In the property pages, select start option.
Using this feature, you need not select “Set as Start Page" option whenever you want to switch between aspx pages. This option is very useful when you are showing demo where you need to run different aspx pages for each demo. Whenever you change the aspx page for demo, it will start with that aspx page.
Default start option is "Use Current Page", but once you use "Set as Start Page" option in VS.NET. Start option will change to "Specific Page" and it will point to the selected page. In this option, though you move between aspx pages in VS.NET, it will always open with the specified page.
Another tip for "Specific Page" option is, you can specify query string parameter along with the url. This feature is very useful when you want to run/debug an aspx page, which requires querystring parameter for its operation. This feature is available in vs.net 2003 also.