In our case, it helped a lot to exclude our migrations folder within the .csproj file,
<Compile Remove="./Migrations/*.cs"/>