Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Nuget restores design elements when upgrading EF Core from 5.0.2 to 5.0.3

$
0
0

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>




Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>