title: Add namespace to all views in ASP.NET MVC 6
body: <p>I’m using MVC 6 and would like to be able to access a particular namespace globally from all of my Razor views. In MVC 5 this was fairly simple; I’d just add the following code to my <code>~/views/web.config</code> file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;system.web.webPages.razor&gt;
      &lt;host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
      &lt;pages pageBaseType="System.Web.Mvc.WebViewPage"&gt;
          &lt;namespaces&gt;
              &lt;add namespace="System.Web.Mvc" /&gt;
              &lt;add namespace="System.Web.Mvc.Ajax" /&gt;
              &lt;add namespace="System.Web.Mvc.Html" /&gt;
              &lt;add namespace="System.Web.Optimization"/&gt;
              &lt;add namespace="System.Web.Routing" /&gt;
              &lt;add namespace="MyProject.WebUI" /&gt;
              &lt;add namespace="MyProject.WebUI.Helpers" /&gt;&lt;!-- Added this line --&gt;
          &lt;/namespaces&gt;
      &lt;/pages&gt;
  &lt;/system.web.webPages.razor&gt;
  </code></pre>
  
  <p>Where I’ve added access to the <code>MyProject.WebUI.Helpers</code> namespace.</p>
  
  <p>In ASP.NET 5, and therefore MVC 6, the <code>web.config</code> file has be done away with, so I’m not sure how to go about doing this any more. I’ve tried searching for an answer, but all I can find is how to do it in current versions of ASP.NET rather than v5.</p>
  
  <p>Any ideas?</p>
  
  <p><strong>Edit:</strong> Clarified which <code>web.config</code> file I would have used.</p>