DCSIMG
How To: Create Virtual Directory for your Service using Script - Guy Burstein's Blog

Guy Burstein's Blog

Developer Evangelist @ Microsoft

News

Guy Burstein The Bu

Disclaimer
Postings are provided 'As Is' with no warranties and confer no rights.

Guy Burstein LinkedIn Profile

TwitterCounter for @bursteg

How To: Create Virtual Directory for your Service using Script

How To: Create Virtual Directory for your Service using Script

Virtual Directory Script

When you want to host your WCF Service in IIS, you should follow several steps:

1. Your service should compile to \bin directory instead of \bin\debug
2. You must change the name of the configuration file from app.config to web.config
3. Create a .svc file in a specific format.
and
4. Create a virtual directory in IIS that points to the physical location of you service (probably not a subdirectory of wwwroot..)

I am using 2 scripts for creating and removing virtual directories for my WCF Services. You can find them here. These scripts also create and remove an application for your service.

Usage:
CreateServiceVirtualDir  relativePath folderName
RemoveServiceVirtualDir  relativePath folderName

Note: You should run these scripts from the directory of your solution.
relativePath is the name of physical directory under the solution folder that your service is located.
folderName is the name you want for your virtual directory.

Enjoy!

Comments

R. Kevin Burton said:

I am using "Publish" in Visual Studio. Doesn't that do the same thing? In fact I think it takes the files from "debug" if that is what is being used and puts them in the /bin directory. It knows to take from debug or not. Are there drawbacks to this that I am not aware of? I welcome any tools to automate this. Thank you.

# February 17, 2007 12:04 AM

Guy Burstein's Blog said:

This is my #200 post, and it is a good time to look back at what I've posted over the last few months.

# March 9, 2007 8:46 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: