Я использовал DevArt Oracle Connector. Я изменил свой web.config следующим образом
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301880
-->
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<connectionStrings >
<!--<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-oapp-20140623054602.mdf;Initial Catalog=aspnet-oapp-20140623054602;Integrated Security=True"
providerName="System.Data.SqlClient" />-->
<add name="DefaultConnection" connectionString="User Id=demouser;Password=demo123;Server=oracle;Direct=True;Sid=orcl;" providerName="Devart.Data.Oracle" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<roleManager enabled="true" defaultProvider="OracleExtendedRoleProvider">
<providers>
<clear />
<remove name="OracleExtendedRoleProvider" />
<!--<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />-->
<add name="OracleExtendedRoleProvider" type="Devart.Data.Oracle.Web.Providers.OracleExtendedRoleProvider, Devart.Data.Oracle.Web, Version=8.4.181.4, Culture=neutral, PublicKeyToken=09af7300eec23701" connectionStringName="DefaultConnection" />
</providers>
</roleManager>
<profile defaultProvider="OracleExtendedProfileProvider">
<!-- <properties>
<add name="friendlyName"/>
</properties>-->
<providers>
<remove name="OracleExtendedProfileProvider" />
<add name="OracleExtendedProfileProvider" type="Devart.Data.Oracle.Web.Providers.OracleProfileProvider, Devart.Data.Oracle.Web, Version=8.4.181.4, Culture=neutral, PublicKeyToken=09af7300eec23701" connectionStringName="DefaultConnection" />
</providers>
</profile>
<membership defaultProvider="OracleExtendedMembershipProvider">
<providers>
<remove name="OracleExtendedMembershipProvider" />
<add name="OracleExtendedMembershipProvider" type="Devart.Data.Oracle.Web.Providers.OracleMembershipProvider, Devart.Data.Oracle.Web, Version=8.4.181.4 Culture=neutral, PublicKeyToken=09af7300eec23701" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" />
</providers>
</membership>
<sessionState mode="InProc" customProvider="OracleSessionProvider">
<providers>
<add name="OracleSessionProvider" type="Devart.Data.Oracle.Web.Providers.OracleSessionStateStore,Devart.Data.Oracle.Web, Version=8.4.181.4, Culture=neutral, PublicKeyToken=09af7300eec23701" connectionStringName="OracleServices" />
</providers>
</sessionState>
<siteMap defaultProvider="OracleSiteMapProvider">
<providers>
<add name="OracleSiteMapProvider" type="Devart.Data.Oracle.Web.Providers.OracleSiteMapProvider, Devart.Data.Oracle.Web, Version=8.4.181.4, Culture=neutral, PublicKeyToken=09AF7300EEC23701" connectionStringName="DefaultConnection" securityTrimmingEnabled="true" />
</providers>
</siteMap>
</system.web>
<system.webServer>
<modules>
<remove name="FormsAuthenticationModule" />
</modules>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Razor" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework codeConfigurationType="oapp.Models.MyDbConfiguration, oapp">
<!-- <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0"/>
</parameters>
</defaultConnectionFactory>-->
<providers>
<provider invariantName="Devart.Data.Oracle" type="Devart.Data.Oracle.Entity.OracleEntityProviderServices, Devart.Data.Oracle.Entity, Version=8.4.181.6, Culture=neutral, PublicKeyToken=09af7300eec23701" />
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
</configuration>
Это сработало для меня.После этого я тоже получил проблему в проекте ProviderService и не смог ее найти.поэтому я изменил этот код в IdentityModels.cs
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using System.Data.Entity;
using System.Data.Entity.Migrations;
namespace oapp.Models
{
// You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
public class ApplicationUser : IdentityUser
{
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
{
// Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
// Add custom user claims here
return userIdentity;
}
}
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public ApplicationDbContext()
: base("DefaultConnection", throwIfV1Schema: false)
{
}
public static ApplicationDbContext Create()
{
return new ApplicationDbContext();
}
static ApplicationDbContext()
{
var config = Devart.Data.Oracle.Entity.Configuration.OracleEntityProviderConfig.Instance;
config.CodeFirstOptions.TruncateLongDefaultNames = true;
Database.SetInitializer(new MigrateDatabaseToLatestVersion<ApplicationDbContext, Configuration>());
}
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder
.Properties()
.Where(p => p.PropertyType == typeof(string) &&
!p.Name.Contains("Id") &&
!p.Name.Contains("Provider"))
.Configure(p => p.HasMaxLength(256));
}
}
internal class Configuration : DbMigrationsConfiguration<ApplicationDbContext>
{
public Configuration()
{
AutomaticMigrationsEnabled = true;
SetSqlGenerator("Devart.Data.Oracle", new Devart.Data.Oracle.Entity.Migrations.OracleEntityMigrationSqlGenerator());
}
}
public class MyDbConfiguration : DbConfiguration
{
public MyDbConfiguration()
{
// this.AddDbProviderServices("Devart.Data.Oracle", new Devart.Data.Oracle.Entity.OracleEntityProviderServices());
this.SetProviderServices("Devart.Data.Oracle", new Devart.Data.Oracle.Entity.OracleEntityProviderServices());
}
}
}
надеюсь, он будет работать и для вас.