1

After much research and trial and error here are the steps that I have found that works:

Environment:

  • Windows 10
  • Postgres 13
  • ASP.NET Core 5

Steps to create:

  1. Create the Identity database on Postgress 13.
  2. GRANT ALL ON DATABASE dbname TO user;
  3. Create an ASP.NET Core project targeting .NET 5 (net5.0) with Individual Authorization.
  4. Add the connection string to the appsetting.json file.
  5. Add the <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.2" /> to the .csproj file.
  6. If the package exits for using SqLite -- remove it.
  7. Rebuild Solution.
  8. In the Startup.cs, change .UsingSqlServer to ,Npgsql.
  9. Save and rebuild.
  10. In the Developer PowerShell run:
  11. dotnet-ef migrations remove If there are no errors then run:
  12. dotnet-ef migrations add InitialIdent If there are no errors run:
  13. 'dotnet-ef' database update`

Now there should be the identity tables in your Postgres database.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
WCS
  • 69
  • 1
  • 15

1 Answers1

0

These steps work for core 5 but not core 3.

WCS
  • 69
  • 1
  • 15