Windows Server AppFabric Beta 2: Deploying services

Microsoft released Visual Studio 2010 RC a while ago, but unfortunately this broke Windows Server AppFabric beta 1. Luckily march 1 MS released beta 2, which works with VS 2010 RC. I’ve installed it and will now try to show you a couple of things.

So what is AppFabric? To be honest, there is another AppFabric, the one for Azure, and that is not the one I am talking about.

What is Windows Server AppFabric?

AppFabric makes installing, administering, monitoring and fixing problems in WCF 4 (!Yes, only starting at .NET 4) services a lot easier by extending IIS and WAS (Windows Activation Services, which are used to host non-HTTP WCF services in IIS). It also adds a distributed caching mechanism (also known as Project Velocity) to make it easier to scale ASP.NET and WCF services. If you’re familiar with BizTalk 2006/2009, you’ll know that the BizTalk Administration application shows you each BizTalk application’s health, what went wrong, how many were executed, etc… AppFabric gives you the same but now for WCF and WF 4 services.

Look at this screen shot:

image

As you can see, after installing AppFabric IIS is now showing these new icons: AppFabric Dashboard, Endpoints and Services. The dashboard will show you the current status of your services (running, stopped, with errors, etc…). Endpoints and Services allow you to list and configure the endpoints and services.

Deploying using AppFabric

AppFabric Hosting Services provides easier deployment of services:

First thing you need to do is to package your WCF service. To do this go to the project properties and select the new Package/Publish tab:

image

You can now select where to create the package (and if your want it as a .zip file) and how to deploy it in IIS.

Now you need to create the deployment package in Visual Studio 2010:

image

Now we can import the application using IIS:

image

This will open the Import Application Package dialog. Use the browse button to open the package .zip file:

image

Hit next:

image

And Next again:

image

Note that the service name is taken from the package properties. Hit next again, hopefully your services will deploy successfully.

image

To verify this, you can go to your site in IIS:

image

And click on Services. You should see your service listed (for example I have three services running here):

image

You can also click on Endpoints to see the list of endpoints:

image

Because of WCF default endpoints you get 4 different endpoints per service; you can modify which types of default endpoints you want, but that is now what I’ll be showing you here.

 

A note on using your own application pool with AppFabric

During my experiments I created a new AppPool for my services. When testing my service, I would always get the following error:

HTTP Error 503. The service is unavailable.

First I thought the solution would be easy. My application pool was stopped. Starting it should fix the problem. But it didn’t.

So I investigated a little further. Seems that my new application pool tries to use .NET 4 version 21006 (beta 2?). I could see this in the Event Viewer:

The worker process failed to pre-load .Net Runtime version v4.0.21006.

I think something didn’t (un)install during my migration to .NET 4 RC. So I’m now using the ASP.NET 4 application pool…