Skip to content

Cannot find MSVC 2019 build tools if installed with Visual Studio 2022 #695

Closed
@ChrisDenton

Description

@ChrisDenton

Reported here: rust-lang/rustup#3024

A brief investigation shows this line to be the problem:

let version_path =
instance_path.join(r"VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt");

If the Visual Studio 2022 does not have the MSVC 2022 build tools then Microsoft.VCToolsVersion.default.txt may be missing. However, if MSVC 2019 is installed Microsoft.VCToolsVersion.v142.default.txt is present. Therefore a possible fix would be to fallback to searching for this and other variations on this file name.

EDIT: This appears to also be broadly true for any version other than latest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-windowsWindows targets and toolchains

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions