我一直没有找到答案,一直在上网冲浪互联网,所以我希望也许你可以帮助我这个.
当使用Visual Studio 2012时,我创建一个新的MVC4 Web应用程序项目并获得一些编译错误.
>我使用Visual Studio 2012创建一个新的MVC4 Web应用程序,我选择Internet应用程序并将其设置为使用RAZOR Engine.
>我去应用程序属性,在应用程序选项卡下,将目标框架从.NET Framework 4.5更改为.NET Framework 4.
>构建会产生以下错误:
Error 1 The type name ‘TableAttribute’ could not be found. This type has been forwarded to assembly ‘System.ComponentModel.DataAnnotations,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35’. Consider adding a reference to that assembly. c:userssaaddocumentsvisual studio 2012ProjectsMvcApplication1MvcApplication1ModelsAccountModels.cs 21 6 MvcApplication1
Error 2 The type or namespace name ‘Table’ could not be found (are you missing a using directive or an assembly reference?) c:userssaaddocumentsvisual studio 2012ProjectsMvcApplication1MvcApplication1ModelsAccountModels.cs 21 6 MvcApplication1
Error 3 The type or namespace name ‘DatabaseGeneratedAttributeAttribute’ could not be found (are you missing a using directive or an assembly reference?) c:userssaaddocumentsvisual studio 2012ProjectsMvcApplication1MvcApplication1ModelsAccountModels.cs 25 10 MvcApplication1
Error 4 The type name ‘DatabaseGeneratedAttribute’ could not be found. This type has been forwarded to assembly ‘System.ComponentModel.DataAnnotations,PublicKeyToken=31bf3856ad364e35’. Consider adding a reference to that assembly. c:userssaaddocumentsvisual studio 2012ProjectsMvcApplication1MvcApplication1ModelsAccountModels.cs 25 10 MvcApplication1
Error 5 The type or namespace name ‘CompareAttribute’ could not be found (are you missing a using directive or an assembly reference?) c:userssaaddocumentsvisual studio 2012ProjectsMvcApplication1MvcApplication1ModelsAccountModels.cs 54 10 MvcApplication1
Error 6 The type or namespace name ‘Compare’ could not be found (are you missing a using directive or an assembly reference?) c:userssaaddocumentsvisual studio 2012ProjectsMvcApplication1MvcApplication1ModelsAccountModels.cs 54 10 MvcApplication1
Error 7 The type or namespace name ‘CompareAttribute’ could not be found (are you missing a using directive or an assembly reference?) c:userssaaddocumentsvisual studio 2012ProjectsMvcApplication1MvcApplication1ModelsAccountModels.cs 87 10 MvcApplication1
Error 8 The type or namespace name ‘Compare’ could not be found (are you missing a using directive or an assembly reference?) c:userssaaddocumentsvisual studio 2012ProjectsMvcApplication1MvcApplication1ModelsAccountModels.cs 87 10 MvcApplication1