Reputation: 2015
I want my mvc application to connect to MySQL
database and I have done the following steps since morning but am missing something.
MySQL
Connector for .Net
(Connector ODBC
5.3)MySQL
for Visual Studio 1.2.6)now when I run the website and try to register, it crashed saying
Could not load type 'System.ComponentModel.DataAnnotations.Schema.IndexAttribute' from assembly 'EntityFramework, Version=6.0.0.0
my .csproj file contains
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="MySql.Data">
<HintPath>..\packages\MySql.Data.6.9.9\lib\net45\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="MySql.Data.Entity, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL" />
<Reference Include="MySql.Data.Entity.EF6">
<HintPath>..\packages\MySql.Data.Entity.6.9.9\lib\net45\MySql.Data.Entity.EF6.dll</HintPath>
</Reference>
My application references include:
I also added
MySql.Data.Entity
from the assemblies in (MySQL
for Visual Studio 1.2.6)I am new to both MVC and MySQL
. So, don't have a clear picture of what could go wrong.
UPDATE Someone suggested on another post that i need to remove it from the gacutil. Now gacutil is saying i need admin privileges to remove an assembly which already have.. Is there a work around? is this the right-solution?
Upvotes: 0
Views: 356
Reputation: 2015
Well, the update i was trying was correct. So the problem was that i had a duplicate EntityFramework dll with version 6.0.0.0 in the gac. And to do that i had to right-click on command prompt and choose "run as administrator" and then try uninstalling the dll.
BOOM!! This was what i was missing.
Upvotes: 0