Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find Visual Studio. VS2015 or VS2017 (with C++) needs to be installed. #3825

Closed
waruqi opened this issue Jul 1, 2018 · 21 comments
Closed

Comments

@waruqi
Copy link

waruqi commented Jul 1, 2018

I've installed the vs2017, but I still can't install vcpkg

PS F:\vcpkg> .\bootstrap-vcpkg.bat
Could not find Visual Studio. VS2015 or VS2017 (with C++) needs to be installed.
+         throw "Could not find Visual Studio. VS2015 or VS2017 (with C ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Could not find ...o be installed.:String) [], RuntimeException
    + FullyQualifiedErrorId : Could not find Visual Studio. VS2015 or VS2017 (with C++) needs to be installed.

My Visual Studio Version:

Microsoft Visual Studio Community 2017
15.0.26228.9 D15RTWSVC
Microsoft .NET Framework
4.7.02558
@carmangary
Copy link

Do you have the C++ features installed?

@waruqi
Copy link
Author

waruqi commented Jul 2, 2018

I have the C++ development environment and SDK installed and I can build c++ program.

@degski
Copy link

degski commented Jul 3, 2018

This might be total crap, but easy to do (and harmless). I'm not sure that that version of VS17 has vswhere installed. I don't have time to check (or feel like it) how the detection in vcpkg works, but there is simple way to check that (and whether it has any effect). You can download the tool here and put it somewhere in your path. Then try again. (I've added this back, just for others to read).

@waruqi
Copy link
Author

waruqi commented Jul 3, 2018

@degski vswhere is not installed.

You can download the tool here and put it somewhere in your path. Then try again.

It works, Thanks!

By the way, why not read registry value HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VS7;15.0\\VC to find vs (vcallvars.bat) or download/run vswhere.exe in bootstrap-vcpkg.bat?

@degski
Copy link

degski commented Jul 3, 2018

Well, great, you're welcome, not crap after all then. The idea of the tool is that it knows and can be queried about all relevant paths in all versions of VS (since the begin of time), but for this information to be generated selectively in case you have several versions installed. I guess that the just read the registry solution does not do a good job in that situation. (you can close the issue then)
PS: it wasn't installed, because the tool was not yet created at the time of the release of that VS version, in newer versions it is included, so you should delete it again after you upgrade to a newer version of VS (which you should, but up to you).

@degski
Copy link

degski commented Jul 3, 2018

Added some stuff, this message is just to let you know that, I'll delete it later.

@waruqi
Copy link
Author

waruqi commented Jul 3, 2018

@degski I see.

: it wasn't installed, because the tool was not yet created at the time of the release of that VS version, in newer versions it is included, so you should delete it again after you upgrade to a newer version of VS (which you should, but up to you).

However, this is not friendly to users who use the old version vs. Not all users are willing to upgrade vs.

@waruqi
Copy link
Author

waruqi commented Jul 3, 2018

Another problem: #3842

@Himel55
Copy link

Himel55 commented Jul 5, 2018

I ran into something similar today. The version of vswhere that I have is 1.0.62, which doesn't have the -prerelease flag and hence the install was failing.
https://github.com/Microsoft/vcpkg/blob/7c4e262e5037b0b4a49775b65b2de55ed9b7b4af/scripts/bootstrap.ps1#L75

@redbeaner
Copy link

redbeaner commented Nov 18, 2018

same to mee, i fix it by change the below. This is due to the vswhere.exe return EMPTY without -all parameter in some case
$output = & $vswhereExe -all -products * -format xml

@oezeb
Copy link

oezeb commented Oct 26, 2019

i got the same problem. i read the comments but did not understand. someone can help me?

1 similar comment
@oezeb
Copy link

oezeb commented Oct 26, 2019

i got the same problem. i read the comments but did not understand. someone can help me?

@nisarggandhewar
Copy link

while running bootstrap-vcpkg.bat i am getting following error.

Could not find MSBuild version with C++ support. VS2015, VS2017, or VS2019 (with C++) needs to be installed.

I have already install VS 2017 Community Edition. and found vswhere.exe file also.
how to resolve this error

@linquize
Copy link

linquize commented May 10, 2020

@nisarggandhewar Could you run
"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -prerelease -legacy -products * -format xml
and post the content here?

@nisarggandhewar
Copy link

nisarggandhewar commented May 11, 2020 via email

@linquize
Copy link

C:\>cd Program Files (x86)\Microsoft Visual Studio\Installer

C:\Program Files (x86)\Microsoft Visual Studio\Installer>vswhere.exe -prerelease -legacy -products * -format xml

@nisarggandhewar
Copy link

nisarggandhewar commented May 11, 2020 via email

@nisarggandhewar
Copy link

nisarggandhewar commented May 12, 2020 via email

@nisarggandhewar
Copy link

nisarggandhewar commented May 13, 2020 via email

@linquize
Copy link

Did you install C++ features from Visual Studio Installer?

@Taylor-Philip
Copy link

I think that a part of the problem may be, that under Windows 7 64-bit Enterprise at least, one cannot " install C++ features from Visual Studio Installer". It is necessary to first "" install the Visual Studio [2019 Enterprise] Installer" and then modify its configuration to support C++ (and any others features that do not come supported out of the box).

Philip Taylor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants