Strange ef dbcontext scaffold experience
Steps to reproduce
- Start with a new ASP.NET Core Web Application (.NET Core)
- Select Asp.NET Core Templates: Web Application
- Install-Package Microsoft.EntityFrameworkCore.Tools -Pre
- Install-Package Microsoft.EntityFrameworkCore.SqlServer -Pre
- Install-Package Microsoft.EntityFrameworkCore.SqlServer.Design -Pre
- Add to Project.json
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview1-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
},
5. cd src
6. cd MyProject
7. dotnet ef dbcontext scaffold -c ApplicationContext -o Models "Data Source=MyServer;Initial Catalog=MyDatabase;Integrated Security=True" Microsoft.EntityFrameworkCore.SqlServer --force
The issue
The database schema is reverse engineered as expected. An unexpected error message is returned with no apparent remedy
dotnet : Done
At line:1 char:1
+ dotnet ef dbcontext scaffold -c ApplicationContext -o Models "Data So ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Done:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Further technical details
EF Core version: 1.0.0-rc2-final Operating system: Windows 10 Enterprise Visual Studio version: VS 2015
@WillBaldwin My suspicion is you'll need to either put single quotes as well as double quotes around the connection string and/or install Powershell 5. Please see #5376 for details.
Actually, the error here is a little misleading, but will be fixed in preview2.
What is happening: Preview 1 logs the message "Done" to the stderr. PowerShell treats any output to stderr as an "error" and shows the warning, but the "dotnet ef" command actually ran just fine. We fixed this for Preview 2 by logging "Done" to stdout instead. This fix was added in https://github.com/aspnet/EntityFramework/pull/5542.
Closing as a duplicate of https://github.com/aspnet/EntityFramework/issues/5012