title: .NET MVC 4.5 - Section not defined
body: <p>I'm rendering a Razor template and would like to define sections, to which I'm able to add content throughout all included pages (namely, javascripts).
  However, all sections so far have come up as empty. If I set them to required: true, I get the error that the section has not been defined. To test this, I added the following code to my main template file:</p>
  
  <pre><code>@section foo {
      &lt;p&gt;Hello&lt;/p&gt;    
  }
  @RenderSection("foo", true)
  </code></pre>
  
  <p>These lines are right on top of each other. The rendering of the template fails with the message <code>Section not defined: "foo".</code></p>
  
  <p>Given that the section is obviously defined, did I maybe miss something in the Project configuration or Controller to enable support for sections? All other @commands (like <code>@RenderBody()</code>)inside the template seem to work fine, so some support for the Razor commands is clearly present.</p>