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
dotnet ef migrations remove throws System.NullReferenceException
#18178
Comments
Well, nothing simpler than providing my solution: There are some left over references to a local nuget, which should be irrelevant to the DbContext. |
Yes, please provide a code sample that works as-is, along with what needs to be done to reproduce the exception. |
This here is a minimal repo You'll find the migration assembly in /src/backend/...EFMigrations |
It looks like you can work around this by adding |
Still running into this issue with today's 3.1.0 release. Have tried removing a prior migration as well as adding and removing an empty migration- both cause the same symptoms and error with the same stack trace as originally reported here. Trying to figure out how to provide code as the solution is based on https://aspnetzero.com which requires a paid license. |
In the meantime, it may be worth noting that if I start with no DB, nuke my migrations and snapshot files, and run
If I upgrade EF related packages, subsequently running |
@joelmdev Please open a new issue and provide as much information as you can. It may turn out that we need a runnable repro to fully investigate, |
@ajcvickers still working on that with the company that develops the licensed code. I'm having some difficulty reproducing this with a demo or open source project and I've yet to identify why. If I can get a repro on a project that I can share I'll open up a new issue. |
@joelmdev did you ever figure out this issue? I'm experiencing it right now |
@bfitz22 It was resolved by the ASP.Net Zero/ ASP.NET Boilerplate team within their codebase in our case. I think it had to do with them incorrectly manipulating their migrations by hand to try to work around this issue, but I haven't had the time to confirm. |
When trying to remove a migration, which I created yesterday, I'll get the following.
This would not be problem per se, BUT it removes the migration while not changing the snapshot. This makes it out of alignment with the database and thus a show-stopper.
Further technical details
EF Core version: 3.0.0
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET Core 3.0
Operating system: Windows 10 1903
IDE: CLI
The text was updated successfully, but these errors were encountered: