[NetCoreCheck] Provide a way to check a range of versions
Currently NetCoreCheck could be used to check whether is specific version of runtime is installed.
Would be also convenient to check whether any version within provided range is installed, e.g.: 3.x, 3.1.x, >=3.0.0, >=5.0.0 < 5.1, etc.
Currently NetCoreCheck could be used to check whether is specific version of runtime is installed.
@Deilan This is not entirely accurate. The point of NETCoreCheck is to answer the question "My app needs runtime x version y and (optionally) has roll-forward policy z, can it run on this machine?" So while this request is not exactly inline with the goals of NETCoreCheck, it can still answer all the questions posed above, for example (assuming requested framework is Windows Desktop):
3.xNETCoreCheck.exe -n Microsoft.WindowsDesktop.App -v 3.x.03.1.xNETCoreCheck.exe -n Microsoft.WindowsDesktop.App -v 3.1.0>=3.0.0NETCoreCheck.exe -n Microsoft.WindowsDesktop.App -v 3.0.0 -r LatestMajor>=5.0.0 < 5.1NETCoreCheck.exe -n Microsoft.WindowsDesktop.App -v 5.0.0 -r LatestPatch
Important Note: The version of NETCoreCheck that supports the roll-forward policy argument (https://github.com/dotnet/deployment-tools/issues/82) hasn't been published yet, meaning the third and fourth examples aren't yet possible without building NETCoreCheck yourself. I'll follow up on that and reply back here once it's done.
Edit: The 6.0.0-preview.1.21179.1 version of the Microsoft.NET.Tools.NETCoreCheck NuGet packages includes support for roll-forward policy. I've updated the sample arguments above to account for the new syntax.
Where is the NetCoreCheck docs?
@GF-Huang It's a simple enough tool that the help output pretty much covers it. The sole purpose of NETCoreCheck is to check if the specified runtime requirement is met on the machine. Here's the help output:
NETCoreCheck [options]
-n, --runtimename - Runtime name (Example: Microsoft.AspNetCore.App)
-v, --runtimeversion - Runtime version in format x.y.z (Example: 1.2.3)
-r, --rollforwardpolicy - (Optional) Roll forward policy (Example: LatestMajor)
-c, --runtimeconfigfile - Path to runtime config file (Example: c:\Foo\Bar.runtimeconfig.json)
-l, --logfile - (Optional) Path to log file
If runtimeconfigfile is specified then runtimename, runtimeversion and rollforwardpolicy shouldn't be.
If 0 is returned the runtime requirement is satisfied.
Examples:
NETCorecheck --runtimename Microsoft.AspNetCore.App --runtimeversion 3.1.0
NETCorecheck -n Microsoft.WindowsDesktop.App -v 5.0.1 -r LatestMajor
NETCorecheck -c c:\Foo\Bar.runtimeconfig.json -l c:\Foo\Bar.log