类型或命名空间ActionExecutingContext或ActionFilterAttribute

时间:2014-10-15 09:03:41

标签: asp.net-mvc

Hello突然我的mvc应用程序开始提供例外:

rror    36  The type or namespace name 'ActionExecutingContext' could not be found (are you missing a using directive or an assembly reference?)    C:\Users\TMM\Desktop\04.09\BEAWEB_WITH_LANG - Copy\MvcBeaWeb\MvcBeaWeb\Filters\InitializeSimpleMembershipAttribute.cs   18  48  MvcBeaWeb
Error   22  The type or namespace name 'ActionFilterAttribute' could not be found (are you missing a using directive or an assembly reference?) C:\Users\TMM\Desktop\04.09\BEAWEB_WITH_LANG - Copy\MvcBeaWeb\MvcBeaWeb\Filters\NoCacheAttribute.cs  9   36  MvcBeaWeb
Error   30  The type or namespace name 'ActionFilterAttribute' could not be found (are you missing a using directive or an assembly reference?) C:\Users\TMM\Desktop\04.09\BEAWEB_WITH_LANG - Copy\MvcBeaWeb\MvcBeaWeb\Filters\InitializeSimpleMembershipAttribute.cs   12  63  MvcBeaWeb
Error   39  The type or namespace name 'ActionResult' could not be found (are you missing a using directive or an assembly reference?)  C:\Users\TMM\Desktop\04.09\BEAWEB_WITH_LANG - Copy\MvcBeaWeb\MvcBeaWeb\Controllers\AccountsController.cs    24  16  MvcBeaWeb

我甚至重新安装了visual studio 2012!

最诚挚的问候,

2 个答案:

答案 0 :(得分:9)

Mika的回答对我有用。那个窗户更新到底是怎么回事??! "您可以做的只是在您的mvc Web应用程序的参考文件夹中 - 删除对System.Web.Mvc的引用,然后再次 - 添加对System.Web.Mvc的引用。这解决了我的问题!是的,问题是因为更新"

答案 1 :(得分:0)

您需要更改解决方案中对System.Web.Mvc的所有引用。只需删除它们并添加新的4.0.0.1版本。

同样在属性中将copy local更改为true。