dotnet / dotnet/EntityFramework.Docs
Document when PersistSecurityInfo=True is needed
- Dominant language
- Mermaid
- Stars
- 1.7k
- Forks
- 2k
- Avg merge
- 7d 23h
- Merged PRs (30d)
- 16
Description
## File a bug
When I pass to `UseSqlServer()` connection string, it connects to the docker db and local db. But when I pass to `UseSqlServer()` `new Microsoft.Data.SqlClient.SqlConnection(connString)`, it fails to connect to the docker db but connects to the local db. Simple repo https://github.com/umbarov/dotnet-sqlserver-gh-actions with Github Actions.
Connects to the docker db and local sql server:
```c#
var context = new AppDbContext(new DbContextOptionsBuilder().UseSqlServer(connString).Options);
```
Fails to connect to the docker db, but connects to the local sql server:
```C#
var context = new AppDbContext(new DbContextOptionsBuilder().UseSqlServer(new SqlConnection(connString)).Options);
```
### Include stack traces
```
Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): Login failed for user 'sa'.
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
)
```
### Include provider and version information
EF Core version: 5.0
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 5.0
Operating system: Windows 10 Pro , Version: 20H2, OS build: 19042.630
Contributor guide
Assessment
This issue has not been assessed yet.