How to configure the Virtual Path of ASP.NET Development Server to be “Root”

How to configure the Virtual Path of ASP.NET Development Server to be “Root”

 

Posted by: Rickie Lee   http://rickie.cnblogs.com

As we know, Visual Studio 2005 & .Net Framework 2.0 provide the built-in test web server, named ASP.NET Development Server (located at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\WebDev.WebServer.EXE). By default, VS 2005 IDE treat each ASP.NET web site project as a sub virtual dir under the root site when running them in test server. Like the following example:

http://localhost:portnumber/ApplicationName/

 

However, in fact we often want to run web site projects in the root site, in order to reference static resources, such as images and CSS files. Although we know that we can use “~” symbol to refer to the root of the virtual web application for dynamic resources, static resources still be in trouble.

 

You can take the following steps to overcome this issue and change ASP.NET web site project as the root site.

1. Run the following command in [Visual Studio 2005 Command Prompt] window:

webdev.webserver /port:8181 /path: "the physical path of your web project" /vpath:"/"

 

2. Configure ASP.NET web project’s property using VS 2005 IDE.

(1) Choose <Start Options> tab page under web project property page dialog.

(2) Select <Use custom server> radio button under Server section, and type the following content into Base URL text box:

http://localhost:8181

Please note that the port number should be the same as the preceding setting.

 

posted @   Rickie  阅读(1227)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示