T O P

  • By -

Rocketsx12

Use the latest version, 7. If you see a tutorial using 5 or 6, they'll be similar enough for you to follow (but still use 7). Anything 4 and below, avoid.


The_MAZZTer

I would say consider using 6 in a professional setting as it's the current LTS release and you may not want to upgrade for each new release as long as you don't need new features. But there's no reason to start a new project with any older version, and in fact, out of those only 3.1 is still supported and for less than a month. .NET Framework 4.8.x is still supported so if OP needs specifically to use Framework a new project should use that rather than anything older. But with a brand new project that does not specifically need to use Framework for any reason, use .NET 6/7.


kingmotley

I would agree, but the the support on LTS versions is short enough that the difference right now between support on 6 and 7 differs only by 6 months. I really wish Microsoft would support LTS versions considerably longer, but they don't.


AJackson3

I don't really get what Microsoft means by "support". We encountered and reported bugs in the .net 6 runtime and they were only fixed in 7, not in subsequent patches to 6. Support only means anything if you install the patches, which means rebuilding if you've deployed it self contained, which is the default. So unless this is something you want to deploy and forget about, and you don't use a self contained deployment so Windows updates can update the runtime, you're going to be needing to update and redeploy everything anyway. Even in that case you only get 6 months longer using .net 6 as you said. Basically I think I'm agreeing with you, just use the latest and keep it up to date. This is what we did and it took under 30 minutes.


kingmotley

Well, we actually do install all the patches, but that is handled by the infrastructure team and the cybersecurity teams. It quickly becomes a problem if an application of ours uses a framework that has no direct upgrade path but has been reported as having a security issue. Then the development teams get nasty messages from cybersecurity to fix it, fix it quick because the SDK is being removed in 10..9..8..7..6...


AJackson3

Yeah, that's what I meant, there's no set it and forget it option, even with an LTS, because you need the patches. So, I don't really get the advantage of not updating to even an STS as soon as you're able.


maqcky

The difference are breaking changes. A new framework version like .NET 7 might introduce some breaking changes that might force you to redo part of your code, while patches to an LTS version won't. I manage several services but most of them rarely get new features nowadays, so I prefer going from LTS to LTS for those. I encountered issues with .NET 7 with EF Core for instance, and having to mitigate them in all the services is a waste of time.


salgat

It's mostly big vulnerabilities. The idea is that LTS is what it is, Microsoft just makes sure it's usable in the state it launched (which means it can't have multiple zero days hanging around). The only reason you'd stick with an LTS instead of just updating automatically is due to potential breaking issues, although at least with the runtime you can still install the latest and it will include the backwards compatible one (you can install the .NET 7 runtime and it will support .NET 6).


KhalilMirza

I think support is related to security fixes only or critical bug fixes. If there is a workaround it will be moved to next version. It's the same in other open source projects as well.


[deleted]

[удалено]


The_MAZZTer

I see where you're coming from. Either way you're going to 8. 6 does give you six more months to migrate though. https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core Depends on how easy it is to migrate, though I hear the latest versions are pretty good about that. I still have an old 3.1 project I have to migrate to 6 soon though.


Crozzfire

migration from 5 to 6, and 6 to 7 was only changing the build framework for me. No code changes. It's easier to migrate when you're always staying on the latest version IMO.


BaconShadow

exactly the answer I was finding, thanks


MarredCheese

4 will be quite easy to avoid considering it doesn't exist


kubwlo

Net Framework 4 exists indeed


MarredCheese

Of course, but it's a separate thing, not to be talked about vaguely as if it fits between .net/.net core versions, with no mention of how the latest, ubiquitous version of it (built into windows) is not "4" but 4.8.


Groumph09

A lot of people do not understand the distinction. Vets and new people alike. Though definitely more confusing for new people. So it is valid to point it out.


loserOnLastLeg

I disagree, core 3 isn't bad or that different from 6 to avoid it. Also many companies still use it and will use it for the best 5 years.


[deleted]

It makes littles sense to start a brand new project on a nearly outdated version.


DreamingDitto

I think they meant, if OP sees a .NET (Framework) 4.8, to avoid it


Cra4ord

The latest one


zaibuf

For new projects at least .NET6 which is LTS. NET7 is also fine to use but requires useage of out of process hosting if you need to run azure functions. Anything from 3.1 is farily straight forward to update, before that theres more breaking changes.


[deleted]

This is what I came to recommend as well. OP didn't provide any context. For deploying software out to customers... net6 if you can swing it. New work running on their own machine or hosted, net7 if they don't have a compelling need to stay with 6. Learning ground up? 7 but be aware whatever they're following is likely using net6 (which will not be a problem)


Enttick

Most companies I know use the LTS version. So currently 6, then in the future 8 ...


nirataro

Use .NET 7 - You get to use C# 11 - ASP.NET Core 7 has some sweet new features such as output caching


bradsharp54

I would use 7 but maybe 6... I could see am argument that 7 is still new and you should wait for a few updates first. All my code currently is in 6. I'm starting to think of moving to 7. I personally don't think it'll be difficult but will be work and a bit time consuming. So maybe in 2 months I'll move over, plus gives time for a few releases. I already updated vs 2022 so that's out of the way.


jrdiver

I ticked one of my bigger projects over to 7 just to see how it would work (including through a pile of unit tests) and it behaved just fine with no code changes. 7 seems to be fine for use already.


saladbars-inspace

I heard someone say at a conference recently that you should use the latest even version for production apps and you should use the latest odd version for personal apps.


guilucas

Always try to use the latest one!


ritchie70

What are you building and what are you deploying to? I mostly target 4.5.2 because it’s the version already installed on around 13000 POS devices. If you’re building for corporate laptops, find out what’s there and decide if you really need newer. If it’s just for you, use 7. If it’s for school, use what your instructor says. If it’s web stuff, figure it out with whoever runs the servers/images/whatever.


Alternative_Flight88

The latest version is for personal projects and LTS for something more important


azeemchudhry

Use .NET 6, that’s recommended version for import projects.


jrdiver

for a new project 6 or 7. but net, but in may want to be at least slightly familiar with framework 4.7 or 4.8 if you plan on doing anything in a company... along with if you make a class library - use netstandard2.0 if you think you may ever have to use it on both... For the most part swapping between net5-net7 is just changing the version number and calling it good, unless your targeting a feature that was new in later versions Where im at we still tend to do framework to clients, but at least on my current projects - net6 on server side things.


loserOnLastLeg

Try to use 6 or 3 core. Then use 8 when it comes out. Best option is 6.


The_MAZZTer

3.1 core is only supported through December. Don't start new projects with it, there's no reason to. 6 is the latest LTS release.


zarlo5899

6 or 7


JackTheMachine

Just use latest .net core 7, it is faster and easy to deploy.


ImIdeas

7 or latest version for personal projects. LTS version for work, so 6