title: ASP.NET MVC Data Annotations Validation ErrorMessageResourceType
body: <p>When using Data Annotations Validation, everything works fine until I try to use resources.</p>
  
  <p>Here's the error I get:
  The name 'ErrorMessageResourceType' does not exist in the current context.</p>
  
  <p>And the code I used:</p>
  
  <pre><code>using System.ComponentModel;
  using System.ComponentModel.DataAnnotations;
  using Microsoft.Web.Mvc;
  
  namespace Project.Models  
  {  
      [MetadataType(typeof(LanguageMetaData))]
      public partial class Language
      {
      }
  
      public class LanguageMetaData
      {
          [Required(ErrorMessageResourceType(typeof(Resources.Errors)), 
                    ErrorMessageResourceName = "IdRequired")]
          public object Id { get; set; }
  
          [Required(ErrorMessageResourceType(typeof(Resources.Errors)), 
                    ErrorMessageResourceName = "NameRequired")]
          public object Name { get; set; }
  
          public object Flag { get; set; }
          public object IsDefault { get; set; }
      }
  }
  </code></pre>
  
  <p>I can't find anything wrong with this. Can someone more experienced help me with what's wrong?</p>
  
  <p>Thank you!</p>