Sometimes, while working on your project, you might get an error like “The type ‘dbcontext’ is defined in an assembly that is not referenced”. In this article, we will discuss how to fix this error.
Table of Contents
The type ‘dbcontext’ is defined in an assembly that is not referenced
The complete error message will be like below
The type ‘System.Data.Entity.DbContext’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘EntityFramework, Version=5.0.0.0
Now, if you got this error by chance, you need to fix it by using the information below.
The type ‘dbcontext’ is defined in an assembly that is not referenced [Solved]
Let’s discuss here multiple approaches to fix the issue the type ‘dbcontext’ is defined in an assembly that is not referenced.
Approach 1: Add the reference of Entity Framework DLL
- Navigate to the below path in your machine.
c:\Program Files (x86)\Microsoft ASP.NET\ASP.NETMVC 4\Packages\EntityFramework 5.0.0-rc\lib\net45- Now try adding the Entity framework DLL
Approach 2: Uninstall and Reinstall the Entity Framework Instance
Try uninstalling the Entity Framework Instance from your machine and then Reinstall the Entity Framework Instance and try doing the same stuff, It should fix your issue.
This is how you can able to fix the error. The type ‘dbcontext’ is defined in an assembly that is not referenced.
You may also like following the articles below
Conclusion
This is how to fix the error “The type ‘dbcontext’ is defined in an assembly that is not referenced” using the information mentioned in this article !!!

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
