0

I have created a .NET Core application. I am using Entity Framework Core with Code first approach and I am creating migrations.

For some reason the .designer.cs file of the migration is not associated with the principal .cs file.

enter image description here

I have seen this solution but it seems is not correct for .net core application.

Any help please?

Thank you

Simone
  • 2,304
  • 6
  • 30
  • 79

1 Answers1

0

Try to use Update instead of Include.

In your .csproj file, add these lines to the ItemGroup:

<Compile Update="yourfilename.Designer.cs">
    <DependentUpon>yourfilename.cs</DependentUpon>
</Compile>
baruchiro
  • 5,088
  • 5
  • 44
  • 66
  • If you use Microsoft Identity Core it generate a first migration called `CreateIdentitySchema` that has the `Deisgner` as sub od the `.cs`... But If I generate it with add-migration something goes wrong... however everything works correctly... it was just a personal "obsession" – Simone Apr 01 '19 at 11:40