asp.net-mvc-3 – ViewBag.Title错误

前端之家收集整理的这篇文章主要介绍了asp.net-mvc-3 – ViewBag.Title错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
针对当前的RC2 – 生成的模板Razor视图包括: @H_301_2@@{ ViewBag.Title = "Details1"; Layout = "/Views/Shared/_Public.cshtml"; }

在ViewBag.Title下有一个红色的波形,这个编译器的错误

@H_301_2@Error 4 One or more types required to compile a dynamic expression cannot be found. Are you missing references to Microsoft.CSharp.dll and System.Core.dll? c:\Visual Studio 2010\Projects\myProj\Views\Webinar\Details1.cshtml 6 2 TTSTrain.Webinars.WebEntry

但项目的建立和运行正常。错误是否表明应该解决的其他问题?

解决方法

我从< compilation>中删除了targetFramework属性后遇到了同样的问题。元素在Web.config文件中。

一旦我恢复了

@H_301_2@<compilation debug="true" targetFramework="4.0">

一切都好运了!

猜你在找的asp.Net相关文章