Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I've been converting some .net "Web Sites" to "Web Applications". This has been going along smoothly. One of the steps that I perform each time I do a conversion is I go to the web section of the project properties and set the virtual directory.

So far, I've set up
-http://localhost/site1
-http://localhost/site2
-http://localhost/site3

Finally, I've received the task of performing a Web Site -> Web Application conversion on the web site that resides on the root directory of our servers. However, if I specify http://localhost/ as the virtual directory in Visual Studio, it results in an error. How do I go about converting the root web site to a web application project in Visual Studio?

like image 665
Vivian River Avatar asked Jul 26 '10 19:07

Vivian River


1 Answers

This feels like a KLUDGE, but I've found a way to do what I want.

First, open the Web settings tab of the project properties in Visual Studio. Set the virtual directory to http://localhost/someDirectory. You cannot set it to http://localhost/ at this point as an error will result. Build your web site to the directory (on disk) where you want to host it from.

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

Now, go in to your IIS settings and change the home directory of your web site to the directory where the web site is built on the disk.

Finally, open the project in Visual Studio again. Go to the web settings tab of the project properties and see that it is set to use the virtual directory http://localhost/.

like image 74
Vivian River Avatar answered Sep 25 '22 01:09

Vivian River