Skip to content

Updated .NET Framework target from 4.0 to 4.6.2 #256

Open
foonix wants to merge 2 commits intoDiscUtils:developfrom
foonix:net462_target_framework
Open

Updated .NET Framework target from 4.0 to 4.6.2 #256
foonix wants to merge 2 commits intoDiscUtils:developfrom
foonix:net462_target_framework

Conversation

@foonix
Copy link

@foonix foonix commented May 14, 2022

4.6.1 and older are EOL as of 20220426.

This caused build problems in VS 2022.

@glenebob
Copy link
Contributor

glenebob commented Mar 8, 2023

@foonix I don't believe there's any reason to target net462 explicitly when netstandard2.0 is also targeted. According to my reading, and to some experimentation I'm doing right now, I believe it's now sufficient to target only netstandard2.0 in class libraries, since older framework version are out of support.

@LTRData
Copy link

LTRData commented Mar 8, 2023

In most cases this is true. However, there are a few things in .NET Framework 4.6.2 that are not in .NET Standard 2.0 that sometimes make the implementation easier and more efficient when targeting 4.6.2 explicitly instead of standard.

@glenebob
Copy link
Contributor

glenebob commented Mar 8, 2023

I'll have to take your word for it. I'm working on a similar PR, but I've gone a bit further and bumped several projects up to NET7.0. Do you think there's reason to explicitly target NET7.0 in a library? Is there any reason to still target NET5.0?

@EricZimmerman
Copy link

I would say no to 5 but also stick with 6 since it's a long term support release.

@LTRData
Copy link

LTRData commented Mar 9, 2023

I usually target .NET 6 and .NET 7 for libraries these days. .NET 6 is a long term service version and lots of project will stay on that version for some time. .NET 7 has several optimizations for both memory and speed, so it is good to have that as an explicit target as well even when no code explicitly use .NET 7-specific API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants