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

Switch DB to UseSqlServer #106

Open
cjwilding opened this issue Jun 24, 2021 · 1 comment
Open

Switch DB to UseSqlServer #106

cjwilding opened this issue Jun 24, 2021 · 1 comment

Comments

@cjwilding
Copy link

I added Microsoft.EntityFrameworkCore.SqlServer to switch to UseSqlServer.

I wanted to see the DB, and I'm more familiar with using a local Sql db vs SQL lite.

It failed with some nonsense.

PM> update-database
Build started...
Build succeeded.
[12:19:29 INF] Entity Framework Core 5.0.7 initialized 'ApplicationDbContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer' with options: None
Microsoft.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
---> System.ComponentModel.Win32Exception (53): The network path was not found.
at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at Microsoft.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover, SqlAuthenticationMethod authType)

This is the most sophisticated implementation I've seen so far, but it's still not right for me. Much of it is over my head, and there are things in here I don't need. That makes it a difficult starting point.

I wanted to find a repo with Identity Server 4 + Identity + Identity UI. This is the closest one I've found, although it seems like you actually made your own controllers that look like the Identity UI ones.

@damienbod
Copy link
Owner

Hi @cjwilding This should work fine. You just need to switch the connection string and add the SQL server nuget package. I have added 7 or 8 steps which you needed to implement in the readme. Also this package still uses ID4. You should consider updating this to the latest package with the correct license as required.

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