Closed ytianxia6 closed 4 years ago
If you run
"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.Component.MSBuild
from a command prompt, does it also not find anything? If not, then you either have an issue with your Visual Studio installation, or you don't have a version of Visual Studio installed that matches those options.
I tried running that code locally and it does return a result for me.
I tried a replacement that can get the result:
def find(find_all=False, latest=False, legacy=False, prerelease=False, products=None, prop=None, requires=None, requires_any=False, version=None):
args = []
# ...
# same as vswhere.find
# simle add -find
args.append('-find')
args.append('MSBuild\\**\\Bin\\MSBuild.exe')
return vswhere.execute(args)
then it can find msbuild by find(requires=['Microsoft.Component.MSBuild'], latest=True)
Ah. It looks like the -find
parameter was added after I originally wrote this. I'll need to add support for it.
I just published version 1.2.0 which adds support for -find
, -path
, and -sort
. Let me know if that works for you.
Fixed in 0fb57343dd18daae56cb473ce9e8337c034ead86
I cannot use this library to find msbuild
then I get the same result as no 'reguires'.