Cannot enable Major version roll-forward for 2.x apps
See original GitHub issueSteps to reproduce
I attempted to enable major-version roll-forward for the dotnetsay .NET Core tool.
I added <RollForward>LatestMajor</RollForward>
within the PropertyGroup
. I get this error:
C:\git\core\samples\dotnetsay>dotnet build
Microsoft (R) Build Engine version 16.3.0-preview-19377-01+dd8019d9e for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 131.58 ms for C:\git\core\samples\dotnetsay\dotnetsay.csproj.
You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(221,5): error NETSDK1103: RollForward setting is only supported on .NET Core 3.0 or higher. [C:\git\core\samples\dotnetsay\dotnetsay.csproj]
Build FAILED.
Expected behavior
I understand why RollForward isn’t enabled in general for 2.x since the feature is new in 3.0. We should special-case the LatestMajor
value to enable it to be used. It is an important scenario for enabling 3.0 users (on 3.x-only machines) to use 2.x tools.
The only other option to enable 2.x tools to run on 3.x is to multi-target. I’m not a fan of that being the only option (in the case you are only doing it for this scenario and not taking advantage of 3.x APIs).
Timeframe
Please consider for 3.0.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top 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 >Started to get "This project is targeting a version of .NET ...
I'm getting this same issue with ASP.Net Core 3.1. The solution has been fine for two years and now it want's to install...
Read more >Running .NET Core Apps on a Framework other than ...
Any application's runtime target version that is higher than the installed runtime version (major, minor or patch) does not run.
Read more >Troubleshoot app launch failures
Configure roll-forward behavior By default, an application requires a framework that matches the same major version that the application ...
Read more >dotnet tool - It was not possible to find any compatible ...
That doesn't work and I get the following error: It was not possible to find any compatible framework version The framework 'Microsoft.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think we should enable it for both
Major
andLatestMajor
- the global tools may wantLatestMajor
but I think evenMajor
would make sense as well.Fixed by dotnet/sdk#3542