# Could not find any instance of Visual Studio

**URL:** https://discourse.cmake.org/t/could-not-find-any-instance-of-visual-studio/15377
**Category:** Usage
**Tags:** os:windows
**Created:** [December 9, 2025, 6:19am UTC](https://discourse.cmake.org/t/could-not-find-any-instance-of-visual-studio/15377 "2025-12-09T06:19:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![JRR](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/j/ecccb3/32.png) [@JRR](https://discourse.cmake.org/u/JRR)
#### Post date: [December 9, 2025, 6:19am UTC](https://discourse.cmake.org/t/could-not-find-any-instance-of-visual-studio/15377/1 "2025-12-09T06:19:18Z")

</div>

Hello,

I am trying to use **cmake 3.23.5**  
with **Visual Studio 2026**  
to create a **Visual Studio 2022** project.

Why am I doing this?

At work we use **cmake 3.23.5** and **VS2022**.

I want to investigate something at home, but Microsoft no longer provides a VS2022 Community edition, only VS2026.

So this is how I got to my situation.

I am using the command

```auto
cmake . -B BUILD -Ax64 -G"Visual Studio 17 2022"

```

but I get the error

```auto
-- Building for: Visual Studio 17 2022
CMake Error at CMakeLists.txt:36 (project):
  Generator

    Visual Studio 17 2022

  could not find any instance of Visual Studio.

-- Configuring incomplete, errors occurred!
See also "C:/Users/John/Desktop/gRPC-Investigation/grpc/cmake/BUILD/CMakeFiles/CMakeOutput.log".

C:\Users\John\Desktop\gRPC-Investigation\grpc\cmake\BUILD>cmake -version
cmake version 3.23.5

CMake suite maintained and supported by Kitware (kitware.com/cmake).

```

I thought order of installation might make a difference so I’ve done the following.

1. Installed VS2026
2. Reboot machine
3. Installed CMake 3.23.5
4. Reboot machine
5. Use the `cmake` command
6. cry

Is there a way to get this to work?

---

<div class="post-metadata">

### Author: ![vre](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/v/f04885/32.png) [@vre](https://discourse.cmake.org/u/vre)
#### Post date: [December 9, 2025, 6:39am UTC](https://discourse.cmake.org/t/could-not-find-any-instance-of-visual-studio/15377/2 "2025-12-09T06:39:19Z")

</div>

AFAIK CMake 4.2.0 is the first released version to support VS 2026.

---

<div class="post-metadata">

### Author: ![Angew](https://discourse.cmake.org/user_avatar/discourse.cmake.org/angew/32/229_2.png) [@Angew](https://discourse.cmake.org/u/Angew)
#### Post date: [December 9, 2025, 1:28pm UTC](https://discourse.cmake.org/t/could-not-find-any-instance-of-visual-studio/15377/3 "2025-12-09T13:28:07Z")

</div>

You cannot generate a solution for a VS version which you don’t have installed, CMake doesn’t support that. Moreso, even if it was somehow possible, it wouldn’t be of much use — if you open an older solution in a newer VS, it will convert it to its latest format.

However, what you can do, is install the appropriate older C++ toolset into your version of VS, and generate a new-version VS solution for use with the old-version toolset (by using CMake’s `-T` command-line argument or GUI equivalent). The platform toolset for VS 2022 is `v143`. Google tells me the VS2026 default toolset is `v145`.

So if you install the `Visual Studio 2022 v143` platform toolset into your VS 2026 and pass `-T v143` to CMake when generating the solution, you should get a VS 2026 solution using the VS 2022 compiler.

---

<div class="post-metadata">

### Author: ![JRR](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/j/ecccb3/32.png) [@JRR](https://discourse.cmake.org/u/JRR)
#### Post date: [December 23, 2025, 3:51pm UTC](https://discourse.cmake.org/t/could-not-find-any-instance-of-visual-studio/15377/4 "2025-12-23T15:51:00Z")

</div>

@Angew, thank you for the suggestion.

In the office we use VS2017, VS2019 and VS2022. I regularly open a VS2017 or VS2019 solution with VS2022. During the open it asks me if I want to use the old format or convert to VS2022. This implies to me that VS has non-destructive backwards compatibility (/chuckle - words I never thought I would use when describing Microsoft.)

However I think the key point that you and the others are making is:

1. CMake can only generate solution files for an installed version of VS
2. VS2026 isn’t supported until CMake 4.2.0
3. I could install the appropriate C++ toolset, i.e. _VS 2022 v143_ and it might take care of my problem.

I will give this a try. Thank you.
