title: WCF: How to understand the web.config file?
body: <p>This is a noob question.</p>
  
  <p>I have a simple WCF REST service, very simple, built from the tutorial.</p>
  
  <p>It is very little code. Just IService1.cs, Service1.svc.cs, and my function lib.</p>
  
  <p>The auto generated web.config has very very little in it.</p>
  
  <p><em><strong>The essence of the problem:</em></strong></p>
  
  <p><strong>The MSDN docs, <a href="http://msdn.microsoft.com/en-us/library/ms733932.aspx" rel="nofollow">like this one</a>, are not clear in explaining how the sections of the web.config files relate to/reference the code, and how they relate to/reference each other.</strong></p>
  
  <p>I can read the docs over and over, but unfortunately they do not help me actually implement a web.config. </p>
  
  <p><strong>I cannot find docs that explain simply</strong>: </p>
  
  <p>"In your code, you have an entry point named <code>/service1/foo</code> So in the web.config, you create a <code>&lt;service&gt;</code> that refers to <code>/service1/foo</code> like this..., and then the <code>&lt;binding&gt;</code> entry ties to the <code>&lt;service&gt;</code> entry like this... then the <code>&lt;behavior&gt;</code> entry ties to the <code>&lt;service&gt;</code> entry like this... </p>
  
  <p>The question (restated): <strong>How does it all hang together?</strong></p>
  
  <p><strong>Background:</strong>
  I want to start using web.config to do throttling, as described here:
  <a href="http://www.danrigsby.com/blog/index.php/2008/02/20/how-to-throttle-a-wcf-service-help-prevent-dos-attacks-and-maintain-wcf-scalability/" rel="nofollow">http://www.danrigsby.com/blog/index.php/2008/02/20/how-to-throttle-a-wcf-service-help-prevent-dos-attacks-and-maintain-wcf-scalability/</a></p>
  
  <p>But my web.config doesn't even have a <code>&lt;system.serviceModel&gt;</code> section.</p>
  
  <p>Thank you!</p>
  
  <p>(I should add that I just had dinner with an experienced .NET dev (7+ years), who said "Oh, the config file is horrible! I have never been able to understand it. I just do it all in code, and save my settings to my own settings file.")</p>
  
  <p>Any input or guidance appreciated! </p>