Wednesday, February 20, 2008

how do i deploy/host a WCF service on remote machine?

With the task completion of hosting WCF service on machine that has installed VS 2008 and now when you are ready to deploy this on remote machine in IIS this is what you do...
1> Publish web site (option with VS 2008) that generates compiled code,
2> Copy the files on your remote machine where you want this WCF service installed,
3> Create a virtual directory and point to the physical folder where .svc files are found.
That's it! :) It's pretty much similar to the traditional web services deployment.
before you install WCF serive on any machine ensure that you have WCF and IIS installed. (IIS 6 and above). WCF is part of .net 3.0 framework. it comes along with .net 3.5 redistributable package as well.

However, here are solutions to few issues you might encounter whilst deploying...
1> After deployment you get error "Service Unavailable" in IE.
Solution - Ensure that you have sufficent rights on the physical folder from where you are executing your service (.svc) ... specially asp_net and IIS workgroup users.

2> sometimes you may just get web configuration error as you launch WCF service in IE .svc ...
Solution - You may want to try specifying custom errors tag in web.config to have exceptions as "remoteonly" so that you can understand the unhandled exceptions thrown by IIS. Sometimes, this just solves the problem...atleast solved for me :)

Previous posts on WCF - http://archdipesh.blogspot.com/search/label/WCF
Cheers - Dipesh

No comments: