OnionArch
OnionArch copied to clipboard
Keyword not supported: 'initial catalog'.
When I run the commands to update the database I get an error. Any idea why ?
Keyword not supported: 'initial catalog'.
C:\Users\mherb\source\repos\OnionArch\Onion.Web>dotnet ef database update -c Dat
aContext -p ../Onion.Repo/Onion.Repo.csproj -s Onion.Web.csproj
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
User profile is available. Using 'C:\Users\mherb\AppData\Local\ASP.NET\Dat
aProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
System.ArgumentException: Keyword not supported: 'initial catalog'.
at Microsoft.Data.Sqlite.SqliteConnectionStringBuilder.GetIndex(String keywor
d)
at Microsoft.Data.Sqlite.SqliteConnectionStringBuilder.set_Item(String keywor
d, Object value)
at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(String v
alue)
at Microsoft.Data.Sqlite.SqliteConnection.set_ConnectionString(String value)
at Microsoft.Data.Sqlite.SqliteConnection..ctor(String connectionString)
at Microsoft.EntityFrameworkCore.Storage.Internal.SqliteRelationalConnection.
CreateDbConnection()
at Microsoft.EntityFrameworkCore.Internal.LazyRef1.get_Value() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.get_DbConnectio n() at Microsoft.EntityFrameworkCore.Internal.RelationalLoggerExtensions.MigrateU singConnection(IDiagnosticsLogger1 diagnostics, IMigrator migrator, IRelational
Connection connection)
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String
targetMigration)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateD
atabase(String targetMigration, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c_
_DisplayClass0_1.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execu
te(Action action)
Keyword not supported: 'initial catalog'.
C:\Users\mherb\source\repos\OnionArch\Onion.Web>dotnet ef database update -c App
IdentityDbContext -p ../Onion.Repo/Onion.Repo.csproj -s Onion.Web.csproj
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
User profile is available. Using 'C:\Users\mherb\AppData\Local\ASP.NET\Dat
aProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
info: Microsoft.EntityFrameworkCore.Infrastructure[100403]
Entity Framework Core 2.0.0-rtm-26452 initialized 'AppIdentityDbContext' u
sing provider 'Microsoft.EntityFrameworkCore.Sqlite' with options: None
System.ArgumentException: Keyword not supported: 'initial catalog'.
at Microsoft.Data.Sqlite.SqliteConnectionStringBuilder.GetIndex(String keywor
d)
at Microsoft.Data.Sqlite.SqliteConnectionStringBuilder.set_Item(String keywor
d, Object value)
at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(String v
alue)
at Microsoft.Data.Sqlite.SqliteConnection.set_ConnectionString(String value)
at Microsoft.Data.Sqlite.SqliteConnection..ctor(String connectionString)
at Microsoft.EntityFrameworkCore.Storage.Internal.SqliteRelationalConnection.
CreateDbConnection()
at Microsoft.EntityFrameworkCore.Internal.LazyRef1.get_Value() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.get_DbConnectio n() at Microsoft.EntityFrameworkCore.Internal.RelationalLoggerExtensions.MigrateU singConnection(IDiagnosticsLogger1 diagnostics, IMigrator migrator, IRelational
Connection connection)
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String
targetMigration)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateD
atabase(String targetMigration, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c_
_DisplayClass0_1.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execu
te(Action action)
Keyword not supported: 'initial catalog'.
C:\Users\mherb\source\repos\OnionArch\Onion.Web>
try to restore the proj..
dotnet restore dotnet build
I tried again. Got project. Restore. Build. Skip migration files since they are there. Run update line. Same error. Ill try it on my home computer . Maybe something is wrong with my work computer
Apologies for not seeing this earlier (I really must check through my email notification settings on here, but that's another story).
@punkouter2018 which branch where you using, and have you changed any code?
Just tried it again. Seems to run now but when I register I get..
NotSupportedException: No IUserTokenProvider named 'Default' is registered. Microsoft.AspNetCore.Identity.UserManager.GenerateUserTokenAsync(TUser user, string tokenProvider, string purpose) Microsoft.AspNetCore.Identity.UserManager.GenerateEmailConfirmationTokenAsync(TUser user) Onion.Web.Features.Account.AccountController+<Register>d__17.MoveNext() in AccountController.cs + var code = await _userManager.GenerateEmailConfirmationTokenAsync(user); System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) System.Runtime.CompilerServices.TaskAwaiter.GetResult()
I think this is related to their not being a UserManager injected in the services.
I'm planning on re-creating this repo from scratch (in a branch) soon, as I've done a few things a little weirdly (I'm chalking that up to my lack of experience with Identity Server when I started this project)
"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=xxxxxxxx;Trusted_Connection=True"
"Data Source", will be missing in your connection string.
This is likely the issue. @punkouter2018, what was your connection string?