How to make .net web application run as root application in Visual Studio

I have converted some .net Web Sites to Web Applications. It goes smoothly. One of the steps that I perform every time I perform a conversion is to go to the project properties web section and set up a virtual directory.

So far I have installed - http: // localhost / site1
- http: // localhost / site2
- http: // localhost / site3

Finally, I got the task of running a website -> Converting web applications to a website located in the root directory of our servers. However, if I specify http: // localhost / as the virtual directory in Visual Studio, this will result in an error. How do I go about converting the root website to a web application project in Visual Studio?

+6
web-applications visual-studio iis website virtual-directory
source share
2 answers

This is similar to KLUDGE, but I found a way to do what I want.

First, open the Internet Settings tab of the project properties in Visual Studio. Set the virtual directory http://localhost/someDirectory . You cannot install it on http://localhost/ at this moment, as this will result in an error. Create your website in the directory (on disk) where you want to place it.

Then open the .proj file in notepad and find http://localhost/someDirectory ; change it to http://localhost .

Now go to IIS settings and change the home directory of your website to the directory where the website is built on disk.

Finally, reopen the project in Visual Studio. Go to the web settings tab of the project properties and make sure that it is configured to use the virtual directory http://localhost/ .

+6
source share

To set the root directory in IIS and right-click "Default Web Site" , go to Properties → "Home Directory" and set the Local Path to the directory of your root web site. Then, when you enter http: // localhost / , he will point to this site.
I am not sure how this will affect your other sites.

Let me know if this works.

+6
source share

All Articles