Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to create database keyword not supported? #3

Open
punkouter2021 opened this issue Nov 13, 2020 · 1 comment
Open

Trying to create database keyword not supported? #3

punkouter2021 opened this issue Nov 13, 2020 · 1 comment

Comments

@punkouter2021
Copy link

What am I missing ? I create a database. Pasted in the connection to the appSetting

Also, will the .net 5 be updated to the final version ?

I have gotten the 3.1 version to work

PS C:\Users\punko\downloads\DatingApp\api> dotnet ef database update
Build started...
Build succeeded.
info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
Entity Framework Core 5.0.0-preview.8.20407.4 initialized 'DataContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None
System.ArgumentException: Keyword not supported: data source (Parameter 'keyword')
at Npgsql.NpgsqlConnectionStringBuilder.GetProperty(String keyword)
at Npgsql.NpgsqlConnectionStringBuilder.set_Item(String keyword, Object value)
at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(String value)
at Npgsql.NpgsqlConnectionStringBuilder..ctor(String connectionString)
at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists()
at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists()
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String connectionString, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String connectionString, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_0.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Keyword not supported: data source (Parameter 'keyword')
PS C:\Users\punko\downloads\DatingApp\api> ^C

@surajdotnet
Copy link

surajdotnet commented Jun 22, 2022

Hi go to the file ApplicationServiceExtensions.cs and Line No 59
and change the following from options.UseNpgsql(connStr); to options.UseSqlite(connStr);

I tried updating the .net version to 6.0 but I am getting some errors with .net5 its working fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants