]> Publishing Visual Studio web-sites 🌐:aligrant.com

Publishing Visual Studio web-sites

Alastair Grant | Monday 17 March 2008

I'm doing my nut about trying to publish a web-service I've written in Visual Studio 2005.

I've got my web-files stored locally on a disk within my project structure; which is a reflection of my Source Control. I want to "publish" this web-directory to my local IIS server. Seems simple enough, I click Build->Publish and type in "http://localhost/myservice" and click OK.

I'm then presented with an error message:
"You must choose a publish location that is not a sub-folder of the source web site."

Hmm... how annoying. Searching the web brings little back of help. Just people re-writing the error message with a "duh!" at the end. That's my favourite way of answering things; and I don't like people fobbing it off on me.

It appears that the trick is not to have your project name in the publish path. So if your project is in a directory called "myservice", it's never going to publish under http://localhost/myservice. Even if you do something like http://localhost/myserviceisnotreallyherethankyouverymuch2

So, name your working directory something stupid, and it should work.

Another quality Microshaft product.

Breaking from the voyeuristic norms of the Internet, any comments can be made in private by contacting me.