views:

237

answers:

2

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?

+1  A: 

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.

John Saunders
I see in the start options where I can change it from "Use default Web server" to "Use custom server" and set the Base URL: as http://localhost/Website. That does allow it to run properly, but it's more of a work around. Is there a way to permanently fix it? Or are you referring to a different area?
Noah
@Noah: how is that a workaround? Are there other differences between an IIS site and a file-based site?
John Saunders
@JohnSaunders - I'm not sure what the differences are. With that approach though, each dev box needs to be setup to point to a localhost IIS directory through the project properties, as opposed to just having the project work initially. I sent the Q to MS to see if they could tell me the difference between the 2.
Noah
@Noah: doesn't that setting persist in the project or solution? If it does, then there would be no per-developer setup.
John Saunders
@JohnSaunders - I got the proper fix from MS. I will paste the answer below.
Noah
+2  A: 

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.

Noah
+1 for posting the answer!
John Saunders
My file system based projects are not in source control and when I tried deleteing the suo file and restarting VS2008, it just loaded the same file system based projects.Any workaround this?
chugh97
chugh97, I'm not sure. This was VS2010, so I don't know if it made a difference there or not.
Noah