Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert File System Website to IIS Website

We recently migrated from VS 2008 to VS 2010. The migration went fine, except for our web project. Before, in VS 2008, the site showed up as http://localhost/Website. Now, it appears as C:...\Website. It appears that when we did the migration, VS started to treat it as a file system website.

I've tried removing the existing site and re-adding it as an existing website, but it still displays it as C:...\Website. Is there any way to convert it back to show it as a http://localhost/website, and run through IIS, as opposed to the default ASP.NET Development Server?

like image 249
Noah Avatar asked Apr 26 '10 19:04

Noah


2 Answers

Special thanks to John Dundon at Microsoft for helping me resolve the issue. Here's what he said:

Thanks for all the details. This actually sounds like a quirky behavior in VS that I think I can help you work around.

I believe the reason it’s remembering to use the local development server is because it got stored in the SUO file. So there are two possible ways to fix this:

  1. Re-open your solution from source control as an administrator on the machine with IIS installed and everything should get downloaded to its right place
  2. If you close VS, delete the SUO file (note – this will erase some settings about the state of your solution but shouldn’t cause any real data loss), and then re-open the solution, it should ask you to re-download that particular web site and will try to make it an IIS web site again.

Note however though that since your virtual directory already exists on your machine, it’s going to ask you if you want to use it – I’m assuming you do, but it will overwrite any files when it does.

Let me know if this works for you (and while you technically shouldn’t need to, it may be a good idea to back up any work you’ve done in this enlistment that hasn’t been checked in prior to trying this).

I followed his advice and removed my SUO file and re-opened the solution. The website was automatically fixed as http://localhost/Website and it also checked out the .SLN file as well, and when I checked it in, it fixed the issue for other developers as well. Hope this solution helps out others as well with this quirky issue.

like image 195
Noah Avatar answered Sep 17 '22 00:09

Noah


Look in the project properties, on the Web tab. You'll be able to select whether to use IIS or the development server, and which virtual directory to use.

like image 37
John Saunders Avatar answered Sep 18 '22 00:09

John Saunders