我是否需要每次都安装实体框架时,我使用MVC 4 EF ..? [英] Do i need to install entity framework every time when i used mvc 4 with ef..?

查看:167
本文介绍了我是否需要每次都安装实体框架时,我使用MVC 4 EF ..?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用实体框架,前往第二个上做了MVC 4一个示范项目,但是当我使用的DbContext类,我得到错误,如:
类型或命名空间名称'的DbContext'找不到(是否缺少using指令或程序集引用?)。
即使我增加... System.Data.Entity.dll
在互联网上搜索,许多告知安装从怒江实体框架得到,但我把它安装到previous项目。那么,我需要每天当我使用的时间来安装它使用​​MVC EF ..?
任何人都请帮助...

i have done one demo project on mvc 4 using entity framework and heading to second on, but when i use DbContext class i get error like : The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?). Even if i added System.Data.Entity.dll... When search on internet, many told to install entity framework from Nu get, but i install it in previous project. So do i need to install it every time when i use MVC using EF..?? Anyone please help...

推荐答案

的NuGet没有你的机器上安装软件包,它会下载并要添加它,它在单个项目引用。

Nuget does not install packages on your machine, it downloads and references it in the individual project you are adding it to.

所以,是的,你需要EF添加到您要使用它的每一个项目。

So yes, you need to add EF to each project you want to use it on.

这篇关于我是否需要每次都安装实体框架时,我使用MVC 4 EF ..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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