I am using Entity Framework 6 with an MVC5 webapi2 project against an Oracle database.
I am trying to add some ApplicationRoles in the Seed method, but when I execute update-database I get this exception:
Running Seed method. System.Runtime.Serialization.SerializationException: Type is not resolved for member 'Oracle.ManagedDataAccess.Client.OracleException,Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342'. at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate) at System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner runner) at System.Data.Entity.Migrations.Design.ToolingFacade.Update(String targetMigration, Boolean force) at System.Data.Entity.Migrations.UpdateDatabaseCommand.<>c__DisplayClass2.<.ctor>b__0() at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command) Type is not resolved for member 'Oracle.ManagedDataAccess.Client.OracleException,Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342'.
My code in the Seed method:
var roleStore = new RoleStore<IdentityRole>(context);
var roleManager = new RoleManager<IdentityRole>(roleStore);
if (!context.Roles.Any(r => r.Name == "USER"))
{
var role = new IdentityRole("USER");
roleManager.Create(role);
}
update-database
is creating my tables without any problem, it's just the Seed method which has a problem.
Does anyone have any suggestions as to what the problem could be please?
Thanks.
gacutil
is on path. – Pawsner