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?
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:
- 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
- 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.
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.
精彩评论