简体   繁体   English

使实体框架在所有项目中可用

[英]Make entity framework available in all projects

I have a solution with 3 class library's, one main and 2 that are referenced from the main. 我有一个解决方案,其中包含3个类库,一个main和从main引用的2个。 I installed entity framework 6 successfully from nuget and I can use it ok in the main project. 我从nuget成功安装了实体框架6,可以在主项目中正常使用它。 But my models etc are in this other project but when I add: 但是我的模型等在另一个项目中,但是当我添加时:

using System.Data.Entity;

to the top of my other project I get an error and cant use : DbContext etc. When I install via nuget is that on an individual project basis? 到我其他项目的顶部,我得到一个错误,不能使用:DbContext等。通过nuget安装时,是基于单个项目吗?

Thanks 谢谢

You can manage NuGet references by single project or for entire solution. 您可以通过单个项目或整个解决方案来管理NuGet引用。 Right click on the solution, then click on "Manage NuGet packages for Solution..." to install/remove/upgrade on entire solution. 右键单击解决方案,然后单击“管理解决方案的NuGet软件包...”以在整个解决方案上进行安装/删除/升级。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM