Suggestion: Use SQL Server security for connection strings on Linux
See original GitHub issueFrom @badersur on July 13, 2017 21:3
Steps to reproduce
-
dotnet new mvc -au Individual -uld true
-
dotnet restore
-
ASPNETCORE_ENVIRONMENT=Development dotnet run
-
visit http://localhost:5000/Account/Register, enter data & press register
Expected behavior
The site should register the user & work without any issue
Actual behavior
An error occurred with these messages:
An unhandled exception occurred while processing the request.
NotSupportedException: The keyword 'integrated security' is not supported on this platform.
System.Data.SqlClient.SqlConnectionString..ctor(string connectionString)
....
Solved by changing the connection string to use SQL Server Security:
"DefaultConnection": "Server=localhost;Database=aspnet-MVCAuthSQL;Trusted_Connection=False;MultipleActiveResultSets=true;User Id=SA;Password=my-secret-password;"
I suggest changing the templates to use SQL Server Security on Linux distributions, or adding another connection string (and suggesting to use it in Startup.cs
) or at least link to https://msdn.microsoft.com/en-us/library/jj653752(v=vs.110).aspx#sqlserver in Startup.cs
…
I spent many hours to find the solution (from 4 PM - 11 PM with some breaks!) and I think templates should work by default. Also, the default string seems to applicable for Windows so I believe it should be changed on other platforms.
Environment data
dotnet --info
output:
.NET Command Line Tools (1.1.0-preview1-005051)
Product Information:
Version: 1.1.0-preview1-005051
Commit SHA-1 hash: 5e88564e56
Runtime Environment:
OS Name: ubuntu
OS Version: 17.04
OS Platform: Linux
RID: ubuntu.16.10-x64
Base Path: /usr/share/dotnet/sdk/1.1.0-preview1-005051
Copied from original issue: dotnet/cli#7156
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top GitHub Comments
Hello @mlorbetske and thanks for your reply 😃
After installing dotnet 1.1.0-preview1-005077, I feel it would be nice to introduce other arguments instead of
-uld
to choose one of the EF Core date providers.If I run
dotnet new mvc -h
, I would like to see something like these instead of-uld
:This will reduce some time spent on looking for connection strings, nuget packages and Classes/methods… but it may give an impression that these are the only supported data providers!
I was hoping to have something similar to Laravel’s database configuration but I forgot that ASP.NET Core is an opt-in framework 😕
This issue was moved to aspnet/templating#26