Category: Using NConstruct
Target NConstruct Versions: 2.5 and newer
Document Release Date: December, 2009
2. Solution
Selecting WCF web services hosting
in IIS in NConstruct Builder
Start-up project selection
Selecting Windows integrated authentication on IIS
Assign write permissions for ASP.NET user for log4n logger
Before opening Visual Studio solution file and running the NConstruct application, we need to describe some of the building WCF-DOA applications issues, show how to apply it in NConstruct Builder, how to assign authentication on IIS and write permissions for log4n logger.
Windows Communication Foundation (WCF) is Microsoft’s unified messaging framework for building distributed applications. It is targeted at two types of applications:
Let’s define what we mean by each. “Distributed Objects Applications” are
applications where client and service share common custom business object types
and pass these objects back and forth over the wire. Conversely, SOAs typically
hide business object types and pass lighter data transfer objects between client
and service.
Since the cross-platform interoperability is not a required feature for our needs for the moment, we developed a simple WCF "Distributed Objects Application”.
There are two main characteristics regarding our DOA application:
Let's have a closer look about using NConstruct WCF web services in our NConstruct application.
The generation of WCF web service hosting in IIS is enabled by selecting the following properties as shown in the Figure below.
For the purposes of WCF web service, NConstruct Builder generates the project named [your application name]WCFWebHost.csproj (for example NorthwindWCFWebHost.csproj).
After generating the application and opening Visual Studio 2008 IDE (for example NorthwindNConstruct.sln), the following question will be asked by Visual Studio 2008 as shown in the Figure below:

Click Yes to let Visual Studio to create the virtual IIS directory.
If IIS successfully creates the virtual directory, our Visual Studio solution will load successfully and the WCF web services project hosting in IIS will look like the following Figure:

Before you run your application you have to execute certain steps:
Select Northwind.Client.StartApplication and mark it as a start-up project in your solution.
Go to Control Panel > Administrative Tools > Internet Information Services.
Find NorthwindWCFWebHost node and click on it with the right mouse and select Properties. The following window appears:

Go to the Directory Security tab, click on the Edit button and tick the check-box Integrated Windows authentication as in the following Figure:

To enable log4net for logging, you have to assign write permissions on the application directory. Find [Your project dir]\Northwind\Src\Northwind\NorthwindWCFWebHost directory and click with the right mouse and select Sharing and Security option.

Select the Security tab and allow the Write permissions for the ASP.NET user like in the Figure:

You may now safely run your client application.
If you want to stop your web service, run Task Manager (shortcut hint: CTRL+SHIFT+ESC) and select the aspnet_wp.exe process and select End Process.

You can also Run and Debug your server application with opening the separate Visual Studio solution file found in [your application dir] Src\[your application name]\ [your application name]WCFWebHost\[your application name]WCFWebHost.sln (for example NorthwindWCFWebHost.sln).
As we have shown throughout this short review, it is quite simple to integrate NConstruct application with WCF web services within IIS. More about WCF web services and NConstruct will be described in separate technical articles.