title: In a view, why does visual studio not know that a semi colon after a model directive is going to cause a runtime error?
body: <p>I'm very very new to MVC3, and ran in to a problem very soon after going thru the asp.net mvc3 tutorials from pluralsight.</p>
  
  <p>Trying out the strongly typed example of the introduction 'adding a model' section, This works: </p>
  
  <pre><code>@model MvcApplication1.Models.RestaurantReview
  @{
      ViewBag.Title = "Home Page 1";
  }
  ... 
  </code></pre>
  
  <p>But this doesn't... it builds, and then chokes on a runtime error:</p>
  
  <pre><code>@model MvcApplication1.Models.RestaurantReview;
  @{
      ViewBag.Title = "Home Page 1";
  }
  ... 
  </code></pre>
  
  <p>The only difference being that semi colon after the @model directive, turning it in to a statement, rather than a directive.</p>
  
  <p>Why doesn't visual studio know that this is going to crash? The error message that IIS presents during the crash isn't even the correct line number of where the error actually is in the code. </p>
  
  <p>VS does underline the line in red, telling me that only such and such can be used in a statement, but it doesn't prevent the build success. </p>
  
  <p>This seems like it would be a nightmare to debug in a big project if it wasn't caught right away, no?</p>