Closed freudi74 closed 3 years ago
hi @freudi74
the plugin doesn't really support a version range when specified in the msbuild version as per code if the version is not specified it take the latest already which should suit most of the use case what is the reason behind having both version range in the build.gradle while couldn't just use latest?
the plugin doesn't really support a version range when specified in the msbuild Basically, it does ... it just fails if multiple installations are in that range are found. At least in terms of VS2015 and newer (when the VSWHERE path finds a version).
what is the reason behind having both version range in the build.gradle while couldn't just use latest? There are many good reasons to lock down to a certain version range. For example, the code might build with VS 2017 and VS 2019 ("[15.0,17.0)"), but we want the build to fail if only VS 2015 is installed, because it would fail anyways or produce undesired results. We also don't want to use untested newer versions of VS to build unless we "allow" them in the build script. Another example would be I only want it to build with VS 2017, but neither VS 2015 nor VS 2019 ("[15.0,16.0)")
thanks for your explanation
I know you claim the project deprecated in favor of the dotnet plugin, but I find it very useful to build MSVC++ projects from gradle. I have recently encountered a problem, though.
When you select a version range, and multiple installed versions that are detected by vswhere satisfy that version range, then the plugin fails. Root cause seems to be, that when setting a version, the MSBuildResolver.findMsbuildByVsWhere() is not adding the "-latest" to the call to vswhere, but the handling of the results from the command line expects only one instance to be reported by vswhere. Combining "-version ..." with "-latest" would work perfectly fine.