I know that with the following command I can get the runtime version
var runtimeVer = System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription;
In my case it returns ".NET 6.0.7"
What i need is to verify programmatically that the version is > 6.0.4.
I would prefer not doing that with a string compare. Is there any best practice or better alternative?
UPDATE: I do not just need a way to get the current version, but a safe way to make sure if it is newer than a specific version, while avoiding string comparison or regex complex expressions