title: Razor in 'custom environment' doesn't accept @model directive
body: <p>I'm trying to parse and compile Razor templates in a sandboxed environment a.k.a. <em>a custom host</em> based on <a href="http://www.matlus.com/razor-engine-host/" rel="nofollow noreferrer">this</a> information (architecture see below).</p>
  
  <p>I'm having troubles getting intellisense to work, so i specified a <code>BuildProvider</code> as stated <a href="https://stackoverflow.com/questions/4158573/need-razor-view-engine-auto-complete-to-work-in-a-class-library">here</a> and followed the '<a href="http://blogs.msdn.com/b/webdevtools/archive/2011/01/20/how-to-get-razor-intellisense-for-model-in-a-class-library-project.aspx" rel="nofollow noreferrer">workaround</a>' provided in the answer to that question.</p>
  
  <p>On <code>@model MyAssembly.MyModel</code> intellisense gives the following error:</p>
  
  <blockquote>
    <p>Could not load file or assembly 'System.Web.WebPages.Razor' or one of it's dependencies.</p>
  </blockquote>
  
  <p>(the assembly <strong>is</strong> referenced and copied local, as well as all other related Razor assemblies)</p>
  
  <p>When parsing and compiling a template however the following error is thrown:</p>
  
  <blockquote>
    <p>Line: 33 Col: 7 Error: The name 'model' does not exist in the current context</p>
  </blockquote>
  
  <p><strong>Any leads/suggestions?</strong></p>
  
  <p>p.s. If i remove the @model directive the template parses and compiles fine</p>
  
  <p>Architecture:</p>
  
  <ul>
  <li>Webapplication: references Class library and provides the .cshtml template files using a model from the 3d party class library.</li>
  <li>Class library: contains RazorHost and BaseTemplate and references 3d party library to add model to .cshtml files provided by webapplication.</li>
  <li>3d Party Class: provides model for webapplication</li>
  </ul>