title: System.ComponentModel.DataAnnotations.compare vs System.Web.Mvc.Compare
body: <p>MVC 4 Beta project fails to compile after upgrading to .Net 4.5.</p>
  
  <p>This happens due to conflict between
  <code>System.ComponentModel.DataAnnotations.CompareAttribute</code>  and <code>System.Web.Mvc.CompareAttribute</code></p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.compareattribute%28v=vs.110%29.aspx" rel="nofollow"><code>System.ComponentModel.DataAnnotations.CompareAttribute</code> MSDN documentation</a> says: </p>
  
  <blockquote>
    <p>Provides an attribute that compares two properties.</p>
  </blockquote>
  
  <p>While <a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.compareattribute%28v=vs.108%29" rel="nofollow"><code>System.Web.Mvc.CompareAttribute</code> MSDN documentation</a> says: </p>
  
  <blockquote>
    <p>Provides an attribute that compares two properties of a model.</p>
  </blockquote>
  
  <p>What is the difference between the two and when it would be "smarter" to use each of them?</p>
  
  <p>10x.</p>