Entity Framework throws an error in my .net namesp

2019-09-10 05:21发布

Error:

The type 'System.Data.Entity.DbContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

As you can see my Entity Framework is complaining at the reference, tried to solve it but got nowhere. Has someone experienced this problem before? I'm basically trying to do this: http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api

1条回答
来,给爷笑一个
2楼-- · 2019-09-10 06:17

Go to your solution and follow this steps(provided that you use a downloaded zip from the page you specified):

  • Right click on sln node and Enable Nuget package restore, then rebuild you sln.
  • If not already installed try open the Manage Nuget Package and check EF is installed.
  • Would not recommend loading dll by hand, but you can try adding it.
查看更多
登录 后发表回答