After upgrading EF Core packages from 5.0.2 to 5.0.3 runtime scaffold using
https://github.com/jdtcn/RuntimeEfCore is broken.
The following namespaces do not exist anymore:
```
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.EntityFrameworkCore.Design.Internal;
using Microsoft.EntityFrameworkCore.Scaffolding.Internal;
```
Code which creates scaffolder
```
static IReverseEngineerScaffolder CreatePostgreScaffolder()
{
#pragma warning disable EF1001 // Internal EF Core API usage.
return new ServiceCollection()
.AddEntityFrameworkNpgsql()
// .AddLogging()
.AddEntityFrameworkDesignTimeServices()
.AddSingleton<LoggingDefinitions, NpgsqlLoggingDefinitions>()
#pragma warning restore EF1001 // Internal EF Core API usage.
.AddSingleton<IRelationalTypeMappingSource, NpgsqlTypeMappingSource>()
.AddSingleton<IDatabaseModelFactory, NpgsqlDatabaseModelFactory>()
.AddSingleton<IProviderConfigurationCodeGenerator, NpgsqlCodeGenerator>()
.AddSingleton<IScaffoldingModelFactory, RelationalScaffoldingModelFactory>()
.AddSingleton<IPluralizer, HumanizerPluralizer>() >
.BuildServiceProvider()
.GetRequiredService<IReverseEngineerScaffolder>();
}
```
throws compile error. IReverseEngineerScaffolder interface is not defined.
How to perform runtime scaffold using 5.0.3 packages ?
Upgrading from 5.0.2 to 5.0.3 has changed line in project file
> <PackageReference Include="Microsoft.EntityFrameworkCore.Design"
> Version="5.0.2">
to
> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.3">
> <PrivateAssets>all</PrivateAssets>
> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
> </PackageReference>
How to fix this so that upgrades will not add additonal elements? After upgrade csproj should contain
> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.3">
> </PackageReference>
Member
52 Points
594 Posts
Nuget restores design elements when upgrading EF Core from 5.0.2 to 5.0.3
Feb 12, 2021 09:53 PM|kobruleht|LINK
After upgrading EF Core packages from 5.0.2 to 5.0.3 runtime scaffold using
https://github.com/jdtcn/RuntimeEfCore is broken.
The following namespaces do not exist anymore: