davit_gri
davit_gri

Reputation: 130

Cannot resolve symbol 'ViewBag'

I'm using VS2010 SP1, MVC3 and ReSharper 6.1.

In one of my projects I have following issue().

Cannot resolve symbol 'ViewBag'

I have this only in my Controllers.

enter image description here

In Views it works fine.

enter image description here

I have check similar issue and try suggested solution but it didn't work.

Can anyone please help me with this.

Upvotes: 5

Views: 6619

Answers (2)

Ganesh Todkar
Ganesh Todkar

Reputation: 537

Make sure that your Controller is derived as

public class YourController : Controller

Upvotes: 5

Bishnu Paudel
Bishnu Paudel

Reputation: 2079

Make sure that you have a right MVC configuration. Ensure you have right config value with this tool http://blogs.msdn.com/b/marcinon/archive/2011/01/13/mvc-3-project-upgrade-tool.aspx

Upvotes: 1

Related Questions