I am having this Error.
The ApplicationDbContext is Auto Generated DbContext, used in account section. Whenever i try to use any Account Controller actions this error occurs. The error originates from
public AccountController()
: this(new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext())))
{
}
I have my own DbContext which works fine and gets all the required Data.
The references are fine. How do i fix this issue.
Update I used some updated Refrences for AspNet.Identity . is it causing the issue?
Update 2 This error occured when I was mixing two Membership provider versions. I first used the default provided with MVC 5 then tried to use MVC 3 membership, then again went back to MVC 5. Then this error started to pop up.
I still have not found the solution to this problem. But as workaround, I recreated the Project will all my previous files, and it worked.
Edit your .csproj
file, and replace the <HintPath>
values with the correct Entity Framework version paths (currently, the latest stable version is 6.1.2):
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EntityFramework.6.1.2\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EntityFramework.6.1.2\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
Verify that the paths exist; if not, install the Nuget package for the version you want.
To be clear, these are the <HintPath>
elements you want to edit to ensure have the current version:
<HintPath>..\packages\EntityFramework.6.1.2\lib\net45\EntityFramework.dll</HintPath>
and
<HintPath>..\packages\EntityFramework.6.1.2\lib\net45\EntityFramework.dll</HintPath>
Leave these set to the major version 6.0.0.0:
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
And
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
I got the same problem and I've tried to modify my .csproj
file and replace the <HintPath>
like what Chris Schiffhauer has showed above but the problem was not solved. Finally, I found out that entity framework dll in my GAC was an old version (6.0.0.0), after removing it, no more problem.
You can easily find it here C:\Windows\Microsoft.NET\assembly\GAC_MSIL
I had a similar error with a test project, both projects had a reference to entity framework 6.0.0.0. I was able to solve it by removing and adding the reference to entity framework again in the test project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With