title: Inherited interface property not found by Model Binding in MVC3 but works fine in MVC2
body: <h2>UPDATE: Problem Solved.</h2>
  <p>Darin Dimitrov's answer contains a link to another, related question. <a href="https://stackoverflow.com/a/7826906/5651">One of the proposed solutions</a> on that page ended up working for us.</p>
  <hr />
  <h2>Original Question</h2>
  <p>The code sample below works in MVC 2 but throws an exception in MVC 3. Does anyone know why MVC 3 introduced this breaking change? Is there a way to get this working in MVC 3 while still allowing me to describe the viewmodel as an Interface from within the view?</p>
  <p>There is another <a href="https://stackoverflow.com/questions/7968304/inherited-interface-property-not-found-by-model-binding">related question</a> on StackOverflow, but it doesn't give me any info as to why there is a difference between MVC 2 and MVC 3.</p>
  <p><strong>Model</strong></p>
  <pre><code>public interface IPerson {
      string Name { get; set; }
  }
  
  public interface ISpy : IPerson {
      string CodeName { get; set; }
  }
  
  public class Spy : ISpy {
      public string Name { get; set; }
      public string CodeName { get; set; }
  }
  </code></pre>
  <p><strong>Controller Action</strong></p>
  <pre><code>public ActionResult Index() {
      var model = new Spy { Name = &quot;James Bond&quot;, CodeName = &quot;007&quot; };
      return View(model);
  }
  </code></pre>
  <p><strong>MVC2 View (Works perfectly)</strong></p>
  <pre><code>&lt;%@ Page Language=&quot;C#&quot; Inherits=&quot;System.Web.Mvc.ViewPage&lt;MvcApp.Models.ISpy&gt;&quot; %&gt;
  &lt;p&gt;CodeName: &lt;%: Html.TextBoxFor(x =&gt; x.CodeName) %&gt;&lt;/p&gt;
  &lt;p&gt;Name: &lt;%: Html.TextBoxFor(x =&gt; x.Name) %&gt;&lt;/p&gt;
  </code></pre>
  <p><strong>MVC3 View (Throws exception)</strong></p>
  <pre><code>@model MvcApp.Models.ISpy
  &lt;p&gt;Name: @Html.TextBoxFor(x =&gt; x.Name)&lt;/p&gt;
  &lt;p&gt;CodeName: @Html.TextBoxFor(x =&gt; x.CodeName)&lt;/p&gt;
  </code></pre>
  <hr />
  <p><strong>MVC3 Exception Information</strong></p>
  <p>I am showing the relevant exception info below, but you can view the entire output of the error page here: <a href="https://gist.github.com/1443750" rel="noreferrer">https://gist.github.com/1443750</a>.</p>
  <pre><code>Runtime Exception
  System.ArgumentException: The property **`MvcApp.Models.ISpy.Name`** could not be found.
  
  Source Error:
  
  Line 1:  @model MvcApp.Models.ISpy
  Line 2:  &lt;p&gt;CodeName: @Html.TextBoxFor(x =&gt; x.CodeName)&lt;/p&gt;
  Line 3:  &lt;p&gt;Name: @Html.TextBoxFor(x =&gt; x.Name)&lt;/p&gt;
  
  
  Stack Trace:
  
  [ArgumentException: The property MvcApp.Models.ISpy.Name could not be found.]
     System.Web.Mvc.AssociatedMetadataProvider.GetMetadataForProperty(Func`1 modelAccessor, Type containerType, String propertyName) +502169
     System.Web.Mvc.ModelMetadata.GetMetadataFromProvider(Func`1 modelAccessor, Type modelType, String propertyName, Type containerType) +101
     System.Web.Mvc.ModelMetadata.FromLambdaExpression(Expression`1 expression, ViewDataDictionary`1 viewData) +421
     System.Web.Mvc.Html.InputExtensions.TextBoxFor(HtmlHelper`1 htmlHelper, Expression`1 expression, IDictionary`2 htmlAttributes) +58
     System.Web.Mvc.Html.InputExtensions.TextBoxFor(HtmlHelper`1 htmlHelper, Expression`1 expression) +50
     ASP._Page_Views_Home_Index_cshtml.Execute() in c:\Projects\MvcApplication1\MvcApplication1\Views\Home\Index.cshtml:3
  </code></pre>
  <blockquote>
  <p><em>Help us Darin Dimitrov, you're our only hope.</em></p>
  </blockquote>