无法解析符号'ViewBag'

时间:2012-06-04 18:00:29

标签: asp.net-mvc resharper

我正在使用VS2010 SP1,MVC3和ReSharper 6.1。

在我的一个项目中,我有以下问题()。

Cannot resolve symbol 'ViewBag'

我只在我的控制器中使用它。

enter image description here

在视图中它工作正常。

enter image description here

我检查了similar issue并尝试了建议的解决方案但是没有用。

任何人都可以帮助我。

2 个答案:

答案 0 :(得分:4)

确保您的Controller派生为

公共类YourController:控制器

答案 1 :(得分:1)

确保您拥有正确的MVC配置。 使用此工具http://blogs.msdn.com/b/marcinon/archive/2011/01/13/mvc-3-project-upgrade-tool.aspx

确保您拥有正确的配置值