Now available Download the AppFabric WCF Service Template C#
Windows Communication Foundation (WCF) is Microsoft’s unified programming model for building service-oriented applications. Windows Server AppFabric provides tools for managing and monitoring your web services and workflows.
The AppFabric WCF Service template brings these two products together providing the following features:
To build and test an AppFabric WCF Service you will need the following:
1: public string SayHello(string name)
2: {
3: // Output a warning if name is empty
4: if (string.IsNullOrWhiteSpace(name))
5: AppFabricEventProvider.WriteWarningEvent(
6: "SayHello",
7: "Warning - name is empty");
8: else
9: AppFabricEventProvider.WriteInformationEvent(
10: "SayHello",
11: "Saying Hello to user {0}",
12: name);
13:
14: return "Hello " + name;
15: }
1: <microsoft.applicationServer>
2: <monitoring>
3: <default enabled="true" connectionStringName="ApplicationServerMonitoringConnectionString" monitoringLevel="EndToEndMonitoring" />
4: </monitoring>
5: </microsoft.applicationServer>
6:
7: <system.serviceModel>
8: <diagnostics etwProviderId="830b12d1-bb5b-4887-aa3f-ab508fd4c8ba">
9: <endToEndTracing propagateActivity="true" messageFlowTracing="true" />
10: </diagnostics>
11: <behaviors>
12: <serviceBehaviors>
13: <behavior>
14: <etwTracking profileName="EndToEndMonitoring Tracking Profile" />
15: <serviceMetadata httpGetEnabled="true" />
16: </behavior>
17: </serviceBehaviors>
18: </behaviors>
19: </system.serviceModel>
To see the events in Windows Server AppFabric you need to deploy the Web project to IIS or modify your project to host the solution in the local IIS Server. For this example you will modify the project to host with the local IIS server.
Run Visual Studio as Administrator
If you are not running Visual Studio as Administrator, exit and restart Visual Studio as Administrator and reload your project. For more information see Using Visual Studio with IIS 7.
Happy Coding! Ron Jacobs http://blogs.msdn.com/rjacobs Follow me on twitter: http://twitter.com/ronljacobs
Thanks for this. However, it seems to have a dependency on the Team Architect edition. When I add a project item using this template, I get the following Visual Studio error, which prevents me from proceeding:
Error: this template attempted to load component assembly 'Microsoft.VisualStudio.TeamArchitect.PowerTools.Features, Version=1.0.1.15940, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'...
It uses the Feature Builder Power Tool - I think this works on other editions of Visual Studio but I've not tested it on the different versions.
Here's my experience installing Feature Builder Power Tool into VS Pro: the installer had one option: "Install into VS Ultimate". Ignoring this version mismatch, it appeared to install without error. After restarting VS, the "AppFabric WCF Service Template" continued to display the same error as above.
In using the "Feature Builder Power Tool" project templates, I encountered multiple errors related to missing templates. So, I'm guessing that there is a dependency on Ultimate.
Oh... darn! I was looking forward to reducing my learning curve with your templates. I especially appreciate the nice walkthrough that you have above. Would you be able to include a VS solution for those of us without Ultimate? Thx
Well... it occurred to me that the order of installation may matter. So, I started over installing Feature Builder Power Tools first. Now, your AppFabric template works, and I am happy! Thx. (For clarity, the Feature Builder project templates still encounter the same errors and don't seem to work.)
@John - great! Glad you kept at it.