How to use EF6(not core) with Net6.0

215 views Asked by At

Currently lot of our services written in .NET framework 4.7 uses common library that contains EF6 migrations and DBContext.

The library currently targets 4.7 framework. This library is consumed by our services as a NuGet package.

We want to move one of the service from .netframework 4.7 to Net6.0. What approach should we use ?

Will below approach work:

  1. Targeting data library project to both .Net frameowrk 47 and netstandard2.1.

    net471;netstandard2.1

  2. Since NuGet support packages with multiple target frameworks, services still on netframework 4.7 will continue to use library version with .NET framework 47. Service which will be moved on .Net6.0 will use nerstandard2.1.

If it is a possible solution, can someone confirm if our Net6.0 service will be cross-platform or not ?

1

There are 1 answers

0
ErikEJ On

Yes, adding multiple targets to your library will be the way to go and make your .NET 6 service cross platform