I have a very simple code-first dotnet core webapi project generated from netcoreapp2.1 in VSCode and I also added two migrations using dotnet ef migrations add [migration-name]. Everything seems to work as expected, except I suddenly get this compile error (you can disregard the brackets in the migration name):
Type '[migration-name]' already defines a member called 'Up' with the same parameter types
Technically I know why this happens but I'm note sure if this is intentional behavior when working with migrations. Is it expected to update the namespace every time a new migration is created or am I missing something obvious here?
I did a couple of google searches for this issue but surprisingly I did not get any hits that covered this issue.
I found the cause for this - I previously removed some of the failed migrations by deleting the files instead of using dotnet ef migrations remove and so I had an obsolete .cs file with the same methods in my migration folder. Removing the file solved the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With