MvcBuildViews真正的实体框架在ASP.NET MVC 2 [英] MvcBuildViews true with Entity Framework in ASP.NET MVC 2

查看:493
本文介绍了MvcBuildViews真正的实体框架在ASP.NET MVC 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VS 2010中,改变< MvcBuildViews>真< / MvcBuildViews方式>如果您正在使用实体框架在MVC2项目的.csproj的文件会导致错误。

In VS 2010, changing <MvcBuildViews>true</MvcBuildViews> in a MVC2 project's .csproj file causes an error if you are using Entity Framework.

未能加载类型'System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider。 C:\\ WINDOWS \\ Microsoft.NET \\框架\\ v4.0.30319 \\ CONFIG \\ web.config中129

Could not load type 'System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider'. C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config 129

我要建立的观点,而我调试,我也​​希望我的项目编译!

I want to build views while I'm debugging, and I also want my project to compile!

推荐答案

可以解决这个MVC中加入以下元素你的web.config文件编译的问题:

You can resolve this MVC compile issue by adding the following element to your web.config file:

<add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

这将告诉编译器在哪里可以找到丢失的类型。

This will tell the compiler where to find that missing type.

这篇关于MvcBuildViews真正的实体框架在ASP.NET MVC 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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