nullreference when during add-migration when migration implementations lack migration attribute #9920
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
good first issue
This issue should be relatively straightforward to fix.
help wanted
This issue involves technologies where we are not experts. Expert help would be appreciated.
type-bug
Milestone
if you implement a migration hook and forgetting the attribute. Then call
add-migration foo
If you are seeing an exception, include the full exceptions details (message and stack trace).
Steps to reproduce
Further technical details
The problem is the below code from
MigrationsAssembly.cs
using?.
not realizing that you cannot use null as a key. The error message should not be nullreferenceexception, but rather that the implementor forgot to apply an attribute.Similarly, if using the attribute, and forgetting the subclassing, and error should be show. This is not the case now where only subclasses are investigated
https://github.com/aspnet/EntityFrameworkCore/blob/888b188731264cf2cebee16ce5a9ad4e65fe6f8c/src/EFCore.Relational/Migrations/Internal/MigrationsAssembly.cs
The text was updated successfully, but these errors were encountered: