ViewBag.Title错误 [英] ViewBag.Title error

查看:530
本文介绍了ViewBag.Title错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

工作逆水RC2 - 即产生剃刀享有模板包括:

Working against the current RC2 - the template that is generated Razor views includes:

@{
    ViewBag.Title = "Details1";
    Layout = "/Views/Shared/_Public.cshtml";

}

通过一个红色波浪下ViewBag.Title这个编译器错误:

With a red squiggly under ViewBag.Title and this compiler error:'

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

不过,这个项目建立并正常运行。是错误指示应该解决的其他问题?

But the project builds and functions correctly. Is the error indicative of other problems that should be addressed?

推荐答案

我得到了同样的问题后,我删除从&LT的 targetFramework 属性;编译方式> Web.config文件中的元素

I got the same problem after I removed the targetFramework attribute from the <compilation> element in the Web.config file.

在我把它恢复到

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

一切又工作得很好!

Everything worked fine again!

这篇关于ViewBag.Title错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆