Computer
Computer

Reputation: 2227

What is involved in creating SDK style project?

I have an old .Net Class Library project project with some old ADO .Net code to run SQL queries but also has some third party libraries that have been upgraded over time.

I think its time to upgrade this to Entity Framework so was considering moving this from .Net 4.7 to .Net 6 at the same time too.

It seems i have to upgrade the project to an SDK version but with it being a large project could i upgrade this to an SDK version using .Net 4.7 so I could replace existing projects with the newer version of the class library and the introduce .Net 6 at a later date?

I dont want to do a large upgrade but prefer to take it in smaller chunks but after researching around i cant find a good enough answer to see if i should focus on an upgrade or a rewrite (we want to leave a rewrite as a last resort)?

Upvotes: 2

Views: 388

Answers (1)

Steve E
Steve E

Reputation: 101

So firstly, we should probably clear up some understandings. .Net 4.7 is actually .NET Framework, and .Net 6 is what evolved from .NET Core, now referred to simply as .NET. (Further, .NET [Core] skipped versions number in 4.x to try to reduce this confusion)

.NET Framework and .NET are different. .NET Framework is Windows only; .NET is cross-platform. Not all the libraries you may have used with .NET Framework may be available for .NET [6].

I don't think it would necessarily require a rewrite, but you're going to need to do some research into what targets the libraries you're using are targeted at in their TargetFrameworks attribute. For example, here's one from a library I use:

<TargetFrameworks>net462;netstandard2.0;netstandard2.1;net6.0;net7.0</TargetFrameworks>

net462 is indicating it can target .NET Framework 4.6.2 specifically.

net6.0 and net7.0 are similar, but for .NET 6.0 and .NET 7.0 respectfully.

netstandard2.0 and netstandard2.1 are probably the more useful ones for you at this point. They refer to standardization between various versions, meaning it can potentially target both .NET Framework and .NET, which is what you're looking for here to not have to rewrite. You can read more about .NET Standard here.

Regarding EntityFramework specifically, it looks like you may be possible as a stepping stone, though its target would be .NET Framework 4.5 rather than 4.7, so mileage may vary. It supports .NET Standard 2.1, though which should make it viable for later .NET versions (6+). I'd recommend getting your application into .NET (5+ at least) as soon as you're able, though, and switching to EntityFrameworkCore when you get the chance.

Upvotes: 3

Related Questions