I have an ASP.NET MVC 5 web application. In every .cshtml view file i get the following error for Viewbag: One or more types required to compile a dynamic expre
I hope this will help someone. Works for me in VS 2013 with asp.net MVC 5 and .NET 4.6.1
Readding Microsoft.CSharp
did not fix the problem. Also, adding System.Core
to system.web/compilation/assemblies/
at web.config did not fix too.
I overcame this only this adding System.Web.Mvc
to system.web/compilation/assemblies/
section:
Rebuilded the solution and red line disappeared.