Websites and Branches

If you've ever worked with websites in source control, you've probably encountered the following message after opening a solution from different branches:

This solution contains a web site at ‘http://localhost/Website’. There is already a web site at this location on this computer. Do you wish to use this existing location for your web site (existing files will be overwritten)?

In my experience, clicking yes and reusing the existing location can result in unexpected behavior seemingly due to the fact that files are not removed from the IIS or .NET temporary files relating to the existing virtual directory.

For that reason, I've trained myself to always click 'no' which causes the website to have a location something like 'http://localhost/Website_1'. Not ideal, but it works.

What I've never figured out is how to either bring back up the dialog asking about location reuse or fix the errors that occur after reusing the existing location. The best solution I could come up with was to delete the solution user options (.suo) file and reopen the solution. Keep in mind the .suo file is hidden so you may have to enable “show hidden files and folders” in order to remove it.

I imagine there's a better way to resolve this issue, so I'd be more than happy to receive other suggestions.

blog comments powered by Disqus