Last post Sep 22, 2016 04:27 AM by Cathy Zou
Sep 21, 2016 11:31 PM|rajkumar.private|LINK
I have moved my model to a new class library project. I will write my Code First classes there with DbContext class. My issue is that I am not able to use DbContext although I have used the namespace System.Data.Entity;
The Error is "The type or namespace DbContext could not be found (Are you missing a using directive or assembly reference)
Below is my code:
public class EFPOCContext:DbContext
Sep 21, 2016 11:56 PM|senthilwaits|LINK
Try add EntityFramework.dll reference
Sep 22, 2016 04:27 AM|Cathy Zou|LINK
As we all known, the DbContext lives in EntityFramework.dll. So, you need to make sure that you are referencing the appropriate Entity Framework reference files (System.Data.Entity.dll or EntityFramework.dll depending on your version) within your Project under
You can do that through the following steps :
1.Right-click your Project in the Solutions Explorer.
2.Choose Add Reference...
3.Look for the System.Data.Entity.dll file (or the EntityFramework.dll) and add them to your Project.
You can also accomplish the same thing through following the steps senthilwaits provided.
Hope this can help you. If you have any question and confusion about the problem. Please don't hesitate to let me know.