0

Hi I'm trying to implement asp.net identity with the database in a different assembly without success. Anyone have any examples thanks ?

The database will serve as both my application and identity db. I got that by following this guide by Daniel Eagle which is fine but he has the identity database in the same assembly. It all works when the identity database (DefaultConnection) is in the same assembly as my web app.

I am using a database first approach (so don't mention Database migrations thank you). I have moved the IdentityModels class to the same assembly as the identity/application database. Also I have two connection strings in my web.config - one for the web.app and the other for the identity stuff.

I think the problem may be how to correctly reference the localdb in the other assembly from my web app assembly. Here's my identity connection from the web.config in my web app assembly:

<add name="IdentityDbContext" connectionString="data source=(LocalDB)\MSSQLLocalDB;attachdbfilename=|DataDirectory|\SSLocalDb.mdf;Initial Catalog=SSLocalDb;Integrated Security=True" providerName="System.Data.SqlClient" />

|DataDirectory| doesn't make much sense here..

Jay
  • 687
  • 2
  • 7
  • 18
  • You could create a database with SQL Server and then connect from all assemblies to it without having troubles where to put the database – FKutsche Feb 02 '16 at 14:17
  • Thanks but has to be sql compact or localdb type. – Jay Feb 02 '16 at 15:25
  • This worked for me [Using Asp.Net Identity DataBase first approach](http://stackoverflow.com/questions/20668328/using-asp-net-identity-database-first-approach) – Jay Feb 10 '16 at 14:33

0 Answers0