I assume that you have the code in your App_Code folder (probably your Entity Framework classes at least?).
Now you can move your code and recompile everything so that you deploy the assembly of the website, and not any source files.
Otherwise, you really need to look at your projects and make sure that nothing is referencing System.ComponentModel.DataAnnotations.
Also, check any web.config in the project in the root directory or in the App_Code folder and make sure no
<add assembly="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
under system.web / compilation / assembly. If this does not happen, you can even try inserting
<remove assembly="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
eg:.
<compilation> <assemblies> <remove assembly="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> </assemblies> </compilation>
You can also verify that it works with an earlier version of ASP.NET so that it builds a version of the DataAnnotations assembly that does not have a Schema attribute (as version 4.5+ does):
<configuration> <system.web> <httpRuntime targetFramework="4.0" /> </system.web> </configuration>
source share