-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Throw better exception when app might be using old ASP.NET pattern #8888
Comments
Dupe of #8164. This will be fixed in 2.0.0-preview2-final. |
ASP.NET Core changed the default pattern for applications in 2.0. Instead of having a ConfigureServices call, there is now a Main method with a BuildWebHost method split out. It was explicitly stated by @DamianEdwards that EF does not need to try to keep supporting the old pattern and instead old applications should:
However, our exception message only suggests the latter, which means that people will not be aware that updating their app to the new pattern is a solution. We should update the message with a fwlink (@divega) to documentation on how to update 1.x ASP.NET Core app to the 2.0 pattern. |
I have created https://go.microsoft.com/fwlink/?linkid=851728. Currently it points to one of the ASP.NET Core walkthroughs, but we should update it as part of dotnet/EntityFramework.Docs#409. |
I don't quite get this, does this mean that for separate data projects, we no longer need a startup class to support EF Tooling? Instead we should do what in Main to support it without needing to implement the IDbContextFactory? I'm seeing this is a new 2.0 project, not a converted 1.x project. This is the program.cs:
|
@shawnwildermuth AFAIR, in 2.0-preview1 we were in an intermediary state in which we didn't support the |
Describe what is not working as expected.
I expected that the startup registration would allow me to use the EF Tools without implementing a IDbConnectionFactory. I do not have an empty constructor on my context class, but by isn't the tooling using DI to create an instance? Here is my DbContext class:
If you are seeing an exception, include the full exceptions details (message and stack trace).
Steps to reproduce
Include a complete code listing (or project/solution) that we can run to reproduce the issue.
Partial code listings, or multiple fragments of code, will slow down our response or cause us to push the issue back to you to provide code to reproduce the issue.
Further technical details
EF Core version: (found in .csproj file)
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Win10
IDE: VS2017 Preview 1
The text was updated successfully, but these errors were encountered: