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.

What should be default RollForward for component projects

See original GitHub issue

We haven’t made an official decision on the default value for RollForward in our new component scenarios.

TLDR; Should we use LatestMinor or LatestMajor for component projects by default.

The long version: Currently RollForward is set to Minor (roll to closest available version while staying with the same major. part of the version, then roll to latest patch of that version) for all projects by default. This is the value used when no RollForward is specified by the SDK in .runtimeconfig.json. More details about RollForward are here and here.

For dynamically loaded components this value would come with problems. The most important one being ordering issues. For example let’s have two COM components A 3.0 Minor and B 3.1 Minor on a machine which has both 3.0 and 3.1 installed. If the native app activates B first, it will load 3.1 runtime and then when it activates A second it will just work (since A can run on 3.1). But if the app activates A first, it would load 3.0 (closest available match to 3.0 Minor) and then when it would try to activate B that would fail (B is not compatible with 3.0).

To overcome this problem the RollForward has two settings:

  • LatestMinor – pick the highest available version with the same major. part of the version (so 3.0 LatestMinor would roll to latest 3.* version)
  • LatestMajor – pick the highest available version (all up)

If in the above scenario A would be 3.0 LatestMinor and B would be 3.1 LatestMinor, no matter which one got activated first, they both would load 3.1 (as the latest 3.* available version).

So to make it easy for users and make things just work out of the box, we would like to set RollForward to one of the LatestMinor/LatestMajor by default on component projects. Elinor has a PR out which introduces the notion of “component project”: https://github.com/dotnet/sdk/pull/3305

The question is if we should use LatestMinor or LatestMajor as the default for component projects.

LatestMinor:

  • Pros: Higher chance of providing the expected compatibility – in general we try really hard to avoid breaking changes for minor versions, so 3.1 is expected to be fully backward compatible with 3.0. We tell people that upgrading to minor version is “safe”.
  • Cons: Come .NET 5 components targeting 3.0 would not run on 5.0. Basically creating an upgrade problem. Combining components targeting both 3.0 and 5.0 would fail.

LatestMajor:

  • Pros: No upgrade problems – all components run everywhere and together.
  • Cons: Potentially breaking for some components as we may introduce some breaking changes between 5.0 and 3.0. That said classlibs (which components are a special case of) are already assumed to work just fine even across major versions (NuGet has no notion of compatibility ranges, and will let people use 3.0 classlibs in 5.0 projects).

Some related discussions already happened: https://github.com/dotnet/core-setup/issues/5870 https://github.com/dotnet/core-setup/issues/5062

Thoughs?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
vitek-karascommented, Jun 27, 2019

LatestMinor it is - code change made in #3305

1reaction
vitek-karascommented, Jun 7, 2019

@jkotas In that case even LatestMinor is risky as installing new minor release could still break things. That said I agree we’re much more careful about changes in minor releases.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exploring the new rollForward and allowPrerelease ...
In this post I explore the new rollForward and allowPrerelease settings added to the global.json file in .NET Core 3.0 and how they...
Read more >
Setting Roll Forward Rules
Enter information to define the roll forward rules for projects that will be created from this template. Closed Explain the roll forward rules...
Read more >
Self-contained deployment runtime roll forward
By default, dotnet publish for a self-contained deployment selects the latest version installed as part of the SDK on the publishing machine ...
Read more >
MSBuild reference for .NET SDK projects
RollForward. The RollForward property controls how the application chooses a runtime when multiple runtime versions are available. This value ...
Read more >
Project Management - Roll Forward
Roll Forward enables you to expedite the process of creating projects and setting their default attributes for subsequent project cycles.
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