How To: Create Virtual Directory for your Service using Script

27 באפריל 2006

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!

Add comment
facebook linkedin twitter email

one comment

  1. R. Kevin Burton17 בפברואר 2007 ב 0:04

    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.

Comments are closed.