question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Proposal] .NET Tools should default to running on the latest available Runtime

See original GitHub issue

Is your feature request related to a problem? Please describe.

Currently, .NET applications use a runtimeConfig to determine which runtime they run on. This is something that is determined at build time, but non-tool .NET applications can override this with various flags and environment variables given to the .NET runtime host. The default rollforward policy is LatestPatch, which allows an application to run on any runtime of the same major/minor version that is at least as high a version as the application was built against.

.NET (local) Tools are a specific kind of .NET application that are intended to be distributed and managed via SDK commands. They are generally development tools/utilities. We think the semantics of tools are such that tools should be able to run on any .NET runtime equal or greater than the runtime the application originally targeted. This will reduce friction for users adopting new SDKS/Runtimes by not completely blocking their workflows without some explicit proof on incompatibility.

Without this change, tool authors must either explicitly set a more flexible roll-forward policy, or multitarget. Multitargeting has the side effect of increasing the overall size of the tool, and still not solving the issue - a tool that multitargets net6.0 and net7.0 will still not run on net8.0 runtimes.

Describe the solution you’d like

There are two places we could address this mismatch:

  • build time, when a tool’s RollForward defaults are baked into the resulting application
  • install time, when any apphosts/runtimeConfigs are authored by the SDK for subsequent executions

Build Time changes

We would change the RollForward of all tools from LatestPatch to LatestMajor. This would cause the desired behavior for all newly-built apps. We would also track a sentinel value that we set the RollForward, so that at install time we could tell if the user explicitly requested a change to the RollForward.

Install Time changes

We would ensure that tools that did not explicitly override to force a certain RollForward behavior would be written with LatestMajor behavior. This helps us plug the existing behavior gap for tools that haven’t been authored with an SDK containing these changes.

Additional context

Issue Analytics

  • State:open
  • Created 8 months ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jander-msftcommented, Feb 9, 2023

As a single data point, if this automatic roll-forward was applied to .NET tools, the dotnet-monitor tool (which is an ASP.NET application that ships as a .NET tool) would likely opt-out of it. There was a change (I believe it was this) between .NET 6 and .NET 7 regarding the NTAuthentication class on which the Microsoft.AspNetCore.Authentication.Negotiate assembly used reflection to access internal APIs. It was changed in .NET 7 in such a way that the Negotiate assembly could no longer lookup the API it was attempting to reflect over. We had to disable roll-forward due to this change.

We’re okay with disabling roll-forward because we are actively working on dotnet-monitor and are releasing previews in lock-step with .NET 8 all up.

1reaction
vitek-karascommented, Feb 7, 2023

My understanding is that this issue is trying to solve the problem that we have a slew of tools already on NuGet, but when we release 8.0 P1, only a few of them will work (those who added rollforward manually). I agree that it would be really nice to have a majority of the tools working from day 1 (especially since we rarely break people anymore). There’s also the fact that some tools are not maintained frequently so it may take a long time (if ever) to get them to run on 8.0)

https://github.com/dotnet/sdk/issues/29949 will only make it easier to test the update (note that I can’t publish the tool with that, since it would modify the min supported version). So the two are only related to the extent that latter makes it easier for people to test major versions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How the .NET Runtime and SDK are versioned
This article explains how the .NET SDK and Runtime are versioned (similar to semantic versioning).
Read more >
Runtime Fabric on VMs / Bare Metal Installation Prerequisites
Creating separate runtime fabrics based upon environment network scope, such as DMZ versus private network. Ensuring that the runtime fabric default pod and ......
Read more >
Docker run reference
By default, all containers, including those with --network=host , have their own UTS namespace. The host setting will result in the container using...
Read more >
AWS Lambda – FAQs
AWS Lambda provides easy scaling and high availability to your code without additional effort on your part. Q: What kind of code can...
Read more >
SDK Runtime
SDK-SDK communication between and app and the SDK Runtime (available in the latest Developer Preview); How views and remote rendering should ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found