Here is what I did before I got this error:
I also faced this problem while using using code first migration. just update the entity framework version to Entity Framework Version 6.1.3 to resolve this. using command on Package manager console "Install-Package Entity Framework -version 6.1.3"