为什么即使在使用Package Manager控制台安装EntityFramework后,EntityFramework命名空间也未定义?

时间:2013-04-16 19:31:54

标签: orm namespaces install entity-framework-5 package-managers

所有

我们使用ASP.NET Web Forms开始了我们的项目。

我们的ASP.NET C#Web应用程序用于以下环境

.NET Framework 4

ASP.NET Web Forms.

IIS 7

Windows 2008

Visual Studio 2010

.NET IDE

C#

HTTPS ( SSL )

我们希望集成Microsoft Entity Framework Version 5。 因此,从Visual Studio 2010中的程序包管理器控制台,我运行以下命令。

PM> Install-Package EntityFramework -Version 5.0
You are downloading EntityFramework from Microsoft, the license agreement to which is        available at http://go.microsoft.com/fwlink/?LinkId=253898&clcid=0x409. Check       the package for additional dependencies, which may come with their own license       agreement(s). Your use of the package and dependencies constitutes your         acceptance of their license agreements. If you do not accept the license         agreement(s), then delete the relevant components from your device.
   Successfully installed 'EntityFramework 5.0.0'.
  Successfully added 'EntityFramework 5.0.0' to PivotServer.

输入'get-help EntityFramework'以查看所有可用的Entity Framework命令。

如上所示,它正确安装了EntityFramework 5.0.0。

此外,在我的ASP.NET Web应用程序中,安装会自动将EntityFramework dll添加到References。

但是,如果我写下面的

“使用EntityFramework”

进入我的一个C#cs文件,然后它声明EntityFramework未定义。

我还卸载了EntityFramework包,然后重新安装它,但它仍然无法重新识别EntityFramework。

请建议我必须采取哪些步骤才能在我的ASP.NET Web项目中定义EntityFramework命名空间。

1 个答案:

答案 0 :(得分:1)

没有EntityFramework命名空间。使用对象浏览器查看应使用的命名空间。