Giter VIP home page Giter VIP logo

bd-dotnet7-vs-dotnet8's Introduction

Repo to demonstrate migration/build issue in dotnet 8

Build error after migrations

vscode โžœ /workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8 (main) $ make demo
 ---Running Demo Case--- 
 ---Installing tools--- 
dotnet tool install --global csharp-ls
Tool 'csharp-ls' is already installed.
make: [makefile:3: tools] Error 1 (ignored)
dotnet tool install --global dotnet-ef --version 8.0.0
Tool 'dotnet-ef' is already installed.
make: [makefile:4: tools] Error 1 (ignored)
dotnet tool install --global roslynator.dotnet.cli
Tool 'roslynator.dotnet.cli' is already installed.
make: [makefile:5: tools] Error 1 (ignored)
 ---Deleting existing migrations--- 
rm -r BuberDinner.Infrastructure/Migrations/
 ---Building Project Before Migrations--- 
dotnet build
MSBuild version 17.8.3+195e7f5a3 for .NET
  Determining projects to restore...
  Restored /workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/BuberDinner.Infrastructure.csproj (in 244 ms).
  Restored /workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Api/BuberDinner.Api.csproj (in 244 ms).
  3 of 5 projects are up-to-date for restore.
  BuberDinner.Domain -> /workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Domain/bin/Debug/net8.0/BuberDinner.Domain.dll
  BuberDinner.Contracts -> /workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Contracts/bin/Debug/net8.0/BuberDinner.Contracts.dll
  BuberDinner.Application -> /workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Application/bin/Debug/net8.0/BuberDinner.Application.dll
  BuberDinner.Infrastructure -> /workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/bin/Debug/net8.0/BuberDinner.Infrastructure.dll
  BuberDinner.Api -> /workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Api/bin/Debug/net8.0/BuberDinner.Api.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.28
 ---Running new migrations--- 
dotnet ef migrations add InitialCreate --project BuberDinner.Infrastructure/ --startup-project BuberDinner.Api/
Build started...
Build succeeded.
Done. To undo this action, use 'ef migrations remove'
 ---Building Project After Migrations--- 
dotnet build
MSBuild version 17.8.3+195e7f5a3 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  BuberDinner.Contracts -> /workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Contracts/bin/Debug/net8.0/BuberDinner.Contracts.dll
  BuberDinner.Domain -> /workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Domain/bin/Debug/net8.0/BuberDinner.Domain.dll
  BuberDinner.Application -> /workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Application/bin/Debug/net8.0/BuberDinner.Application.dll
/workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/Migrations/BuberDinnerDbContextModelSnapshot.cs(414,32): error CS1061: 'OwnedNavigationBuilder' does not contain a definition for 'HasDiscriminator' and no accessible extension method 'HasDiscriminator' accepting a first argument of type 'OwnedNavigationBuilder' could be found (are you missing a using directive or an assembly reference?) [/workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/BuberDinner.Infrastructure.csproj]
/workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/Migrations/BuberDinnerDbContextModelSnapshot.cs(656,32): error CS1061: 'OwnedNavigationBuilder' does not contain a definition for 'HasDiscriminator' and no accessible extension method 'HasDiscriminator' accepting a first argument of type 'OwnedNavigationBuilder' could be found (are you missing a using directive or an assembly reference?) [/workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/BuberDinner.Infrastructure.csproj]
/workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/Migrations/20231230191142_InitialCreate.Designer.cs(417,32): error CS1061: 'OwnedNavigationBuilder' does not contain a definition for 'HasDiscriminator' and no accessible extension method 'HasDiscriminator' accepting a first argument of type 'OwnedNavigationBuilder' could be found (are you missing a using directive or an assembly reference?) [/workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/BuberDinner.Infrastructure.csproj]
/workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/Migrations/20231230191142_InitialCreate.Designer.cs(659,32): error CS1061: 'OwnedNavigationBuilder' does not contain a definition for 'HasDiscriminator' and no accessible extension method 'HasDiscriminator' accepting a first argument of type 'OwnedNavigationBuilder' could be found (are you missing a using directive or an assembly reference?) [/workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/BuberDinner.Infrastructure.csproj]

Build FAILED.

/workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/Migrations/BuberDinnerDbContextModelSnapshot.cs(414,32): error CS1061: 'OwnedNavigationBuilder' does not contain a definition for 'HasDiscriminator' and no accessible extension method 'HasDiscriminator' accepting a first argument of type 'OwnedNavigationBuilder' could be found (are you missing a using directive or an assembly reference?) [/workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/BuberDinner.Infrastructure.csproj]
/workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/Migrations/BuberDinnerDbContextModelSnapshot.cs(656,32): error CS1061: 'OwnedNavigationBuilder' does not contain a definition for 'HasDiscriminator' and no accessible extension method 'HasDiscriminator' accepting a first argument of type 'OwnedNavigationBuilder' could be found (are you missing a using directive or an assembly reference?) [/workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/BuberDinner.Infrastructure.csproj]
/workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/Migrations/20231230191142_InitialCreate.Designer.cs(417,32): error CS1061: 'OwnedNavigationBuilder' does not contain a definition for 'HasDiscriminator' and no accessible extension method 'HasDiscriminator' accepting a first argument of type 'OwnedNavigationBuilder' could be found (are you missing a using directive or an assembly reference?) [/workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/BuberDinner.Infrastructure.csproj]
/workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/Migrations/20231230191142_InitialCreate.Designer.cs(659,32): error CS1061: 'OwnedNavigationBuilder' does not contain a definition for 'HasDiscriminator' and no accessible extension method 'HasDiscriminator' accepting a first argument of type 'OwnedNavigationBuilder' could be found (are you missing a using directive or an assembly reference?) [/workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/BuberDinner.Infrastructure.csproj]
    0 Warning(s)
    4 Error(s)

Time Elapsed 00:00:00.75
make: *** [makefile:21: post-build] Error 1

The difference between dotnet-ef v7.0.1 and dotnet-ef v8.0.0 is that dotnet-ef v8.0.0 adds .HasDiscriminator on line 417 and 659 of /workspaces/bd-dotnet7-vs-dotnet8/BuberDinner-dotnet8/BuberDinner.Infrastructure/Migrations/20231230190557_InitialCreate.Designer.cs

This .HasDiscriminator then causes the build to fail.

bd-dotnet7-vs-dotnet8's People

Contributors

aidenwebb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.