7.1. Configless WCF
One of the most frustrating aspects of WCF for me was the massive amount of configuration needed—it always seemed to be much harder to configure than it should be, especially when compared with the simplicity of creating an ASMX services. With great flexibility and power comes a great big XML configuration file.
WCF4 allows you to create a service with no configuration file at all in just a few lines of code. Let's do this now:
Create a new WCF Service Library project called Chapter7.ConfiglessService.
Add a console application to the solution called Chapter7.ConfiglessHost.
In Chapter7.ConfiglessHost, add a reference to Chapter7.ConfiglessService and the System.ServiceModel assembly.
In Chapter7.ConfiglessHost Program.cs, add ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access