Closed ddevienne closed 5 months ago
vswhere
does not block without -latest
, so I'm not sure what's wrong but I also would not rely on the installed version. It can be quite old. For example, we did fix some UTF-8 output but that behavior was opt-in via the -utf8
flag. But the VS2017 and maybe VS2019 in-box versions don't have that. It should not be UTF-8 with -latest
, though. We have regression tests for that and would've noticed.
-latest
has been a flag since the first version, though. If you're checking for that yourself, you can use just -latest
. I also recall that -property
has been there since the first version, so if you want just the install path, for example, let vswhere
do the work for you in native code as opposed to interpreted script e.g., vswhere -latest -property installationPath
. You can also pass -format
with a couple of flags like xml
or json
for easier processing.
We have had for ages a Python2 script (Python 2.7.13 to be exact) using
vswhere
to locate Visual Studio. Was working fine on my machine with VS2017 and VS2019. But since installing VS2022, that script hangs. Neither the script nor Python changes. We've narrowed it down tosubprocess.Popen()
hanging. Here's the trace after a CTRL-C to get out of the hang:Somehow using
-latest
fixes the hang, but forces us to move to VS2022 unconditionally. Here's the relevant excerpt from the Python2 code that hangs:What could have changed in
vswhere
to explain this behavior? We're at a complete loss to explain what we are seeing. Any idea?