Skip to content

Commit ab3d08c

Browse files
authored
Allow running tool on latest&greatest
It's highly unlikely that a future vesion of the dotnet runtime will break things so fundamentally that the Ulid CLI would fail. Therefore, rather than failing to start as time goes by and new versions of dotnet become prevalent and the current ones targeted by the project become obsolete, let the tool run on whatever version the user has (latest major even). This setting (for example) would have allowed the existing published build targeting the STS .net7 to run on .net8 or even .net9/10 soon, without any issues. As it is now, however, users get an error instead: ``` pwsh> dotnet ulid You must install or update .NET to run this application. App: C:\Users\[user]\.dotnet\tools\dotnet-ulid.exe Architecture: x64 Framework: 'Microsoft.NETCore.App', version '7.0.0' (x64) .NET location: C:\Program Files\dotnet\ The following frameworks were found: 6.0.36 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 8.0.16 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 9.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Learn more: https://aka.ms/dotnet/app-launch-failed To install missing framework, download: https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=7.0.0&arch=x64&rid=win-x64&os=win10 ``` Which is quite a bad user experience.
1 parent 1fe01ee commit ab3d08c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Ulid.Cli/Ulid.Cli.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
<PackAsTool>true</PackAsTool>
1818
<LangVersion>7.3</LangVersion>
1919
<IsPackable>true</IsPackable>
20+
<!-- Allow running on whatever latest version users have. See https://docs.microsoft.com/en-us/dotnet/core/versions/selection#framework-dependent-apps-roll-forward -->
21+
<RollForward>LatestMajor</RollForward>
2022
</PropertyGroup>
2123

2224
<ItemGroup>

0 commit comments

Comments
 (0)