The type ‘dbcontext’ is defined in an assembly that is not referenced

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.

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 !!!