Thursday, May 10, 2012

Hosting WCF/Workflow Service in IIS directly from Visual Studio 2010 and start debugging by just hitting F5 on Visual Studio.

Problem:

When you develop a WCF/Workflow service using Visual Studio and try to run it, by default Visual Studio runs it under web development server. Here the problem is that the web development server is a light weight host and does not support reach features which comes with IIS. For example web development server does not allow you to run a WCF/Workflow service, which is configured to use NET TCP binding. There are many more such features which do not come with web development server.

As a developer we all want to, just hit the F5 button and start debugging. But if your WCF/Workflow service is configured in such a way that it can only run under IIS, it becomes really tricky to start debugging it.

The common approach we generally follow is to out in which w3wp.exe our service is running and then attach the Visual Studio to that process.
In following text, I have shown another approach in which Visual Studio can be configured to run together with IIS. With this configuration your WCF/Workflow Services runs under IIS as soon you hit the F5 and you can start debugging without any hassles.

1.       Create WCF/Workflow server. See how to create basic Workflow WCF Server.
2.       Configure IIS to host your WCF/Workflow service.
(Note: -You can skip following steps if you already have some IIS website configured on port 80 and NET TCP binding is configured. )
a.       Open IIS Manager.
b.      Add new application pool.
        i.   Select 'Application Pools' node from the left hand side tree view.
                ii.  Click on 'Add Application Pool' link from 'Actions' panel at right hand side.
                iii. Give some name to your application pool. I have given name as 'WorkflowService'. In below steps I will refer your application pool as 'WorkflowService'.
                iv. Change .Net Framework Version to 4.0
                v.  Click 'Ok'

Read more: stdeepdive
QR: Inline image 1

Posted via email from Jasper-Net