Hosting WCF Service in IIS

Topics: General Discussion Forum, Service Factory Modeling Edition Forum
May 13, 2009 at 4:52 AM

Hi,

I have created the WCF service using software factory and created both Host and Client under Tests folder and can test the service by accesing from client application.

Now we would like to deploy the service in development environment and we would like to access the svc file using some virtual directory and i don't have idea on that. Can anybody please explain me how to host the service in IIS? 

Developer
May 13, 2009 at 11:19 AM

The fastest way to "re-host" your existing (cassini) service to IIS may be something like this:

1) Create a virtual directory that points to your Hosts project (where the .svc files live) and make sure you have the necessary permissions set for the IIS user to access your service.
2) Edit your Web.Config file in your Client project so that the endpoints instead of referencing 'localhost:{port}' actually reference the new virtual directory. (You may also change settigns in your host model client proxy to update the references/config to the new service URI in IIS).

Regarding #1, you can also create in VS a new web site hosted in IIS and then update your host model to use that site.