Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.net 8.0 #36

Closed
mexmer opened this issue Sep 4, 2024 · 7 comments
Closed

.net 8.0 #36

mexmer opened this issue Sep 4, 2024 · 7 comments
Labels
question Further information is requested

Comments

@mexmer
Copy link

mexmer commented Sep 4, 2024

Hi, just wanted to ask, if you plan to switch to new .NET (8.0 is now LTS) instead of .NET framework.

@Aldaviva
Copy link
Owner

Aldaviva commented Sep 4, 2024

Hi @mexmer,

Thanks for the question. I like .NET 8 a lot, but I wasn't planning on doing this.

Summary: nothing wrong with it, it is feasible, I just don't see a benefit, so it would be a bit of work for no gain.

Here are the reasons I think this:

  • .NET Framework is preinstalled on all targeted Windows versions, whereas users would have to separately download and install .NET Runtime 8
    • It also requires fewer steps to update .NET Framework with Windows Update on Windows Server, because there's a little-known and poorly-documented registry key to enable this for .NET
  • This program wouldn't be improved much by .NET 8's many nice benefits
    • Cross-platform runtimes
    • More built-in libraries like System.Text.Json and WebSockets
    • AOT compilation
    • Minor runtime performance improvements
    • Minor BCL additions like new types (DateOnly is cool, Span and Memory if you have RAM bottlenecks) and methods (Task.WaitAsync is nice), and simpler support for language features like init properties and more features of record types
    • Even though Task.Delay allows longer durations, which this program needs, it's still not long enough, so Task chaining is still required for arbitrary delays
    • TimeProvider is cool, but these automated tests already work without it
    • Not having to prepend each .cs file with #nullable enable
    • Self-contained single-file executables

However, if there is a specific reason to target a .NET runtime like 6 or 8, I would consider multitargeting this project and providing separate downloads for both .NET Framework 4.8 and .NET 8. I won't be removing the .NET Framework build for backwards compatibility with existing installations, and because zero prerequisites is always helpful.

Let me know if there is a feature of the .NET 8 runtime that you are missing in this project.

@Aldaviva Aldaviva added the question Further information is requested label Sep 4, 2024
@mexmer
Copy link
Author

mexmer commented Sep 5, 2024

Thanks for answers. Indeed most of you mentioned makes sense.

Only problem with .NET framework i see, it is not pre installed (unless we talking .NET 2.0, but your app needs 4.8) ... here your assumption is wrong, it's optional component, you need download and install and requires computer restart (just did that few days ago, on windows 2016 .NET 4 feature installs only 4.6 and 2019 server .NET features is version 4.7)
only Windows Server 2022 has 4.8, but even there it's optional feature, that is disabled by default and requires restart after installing.

since i'm writing services for windows server in .NET LTS (now 8, before 6), i'm somewhat familiar with it's downsides too.
for deployment it depends on client, i either created selfconainted or framework dependent, it depends on client environment. Becuase we also provide app updates, i'm not much stressed with lack of windows update support for .NET LTS deployment, we just deliver app update after testing with new .NET release.

Anyways i was just curious, why project stays on .NET Framework, thanks for answers.

@mexmer mexmer closed this as completed Sep 5, 2024
@Aldaviva
Copy link
Owner

Aldaviva commented Sep 5, 2024

Oh yeah I forgot that Server 2016 only starts with .NET Framework 4.6.2 instead of 4.8 before updates. I think I was getting it confused with Windows 10 which has a shorter support lifecycle than Server.

I could have sworn it was preinstalled and didn't require a restart. Are you referring to Server Core/Nano/no-Desktop-Experience? I will have to test this out in a VM to refresh my memory. I don't remember having to install it in either of my server machines, otherwise how would PowerShell work?

Thanks!

@Aldaviva
Copy link
Owner

Aldaviva commented Sep 5, 2024

.NET Framework 4.7.2 was preinstalled in Server 2019 Desktop Experience, and installing the 4.8 update did require a restart. I must have gotten that via Windows Update before attempting to run this program on my real servers.

Thanks again, I know a little bit more about this now.

@mexmer
Copy link
Author

mexmer commented Sep 5, 2024

Oh yeah I forgot that Server 2016 only starts with .NET Framework 4.6.2 instead of 4.8 before updates. I think I was getting it confused with Windows 10 which has a shorter support lifecycle than Server.

I could have sworn it was preinstalled and didn't require a restart. Are you referring to Server Core/Nano/no-Desktop-Experience? I will have to test this out in a VM to refresh my memory. I don't remember having to install it in either of my server machines, otherwise how would PowerShell work?

Thanks!

FYI feature is automatically installed, if you go with "Desktop Experience" setup (this is available for standard, and datacenter edition) or install Windows Server Essentials Edition, because MMC modules are written in .NET Framework. But will still require update, unless you installing Windows Server 2022

@Aldaviva
Copy link
Owner

Aldaviva commented Sep 5, 2024

Seems like a fresh installation of Server 2019 Core (without Desktop Experience) also has .NET Framework 4.7.2 preinstalled. If it didn't, PowerShell 5 wouldn't run. But yeah, an update would be required to get .NET Framework 4.8 on here.

Windows Server 2019 (2)-2024-09-05-06-18-42

@mexmer
Copy link
Author

mexmer commented Sep 5, 2024

You are right, i forgot about powershell. so yes, core is installed, and for your service it would be enough, except it targets 4.8

Aldaviva added a commit that referenced this issue Sep 26, 2024
…ll it on RTM Windows Server 2019 without updating to 4.8, which requires a restart that may be annoying to do for a server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants