# Error MSB4057 The target "GetResolvedWinMD" does not exist in the project.

**URL:** https://discourse.cmake.org/t/error-msb4057-the-target-getresolvedwinmd-does-not-exist-in-the-project/11668
**Category:** Usage
**Tags:** os:windows
**Created:** [September 13, 2024, 12:45pm UTC](https://discourse.cmake.org/t/error-msb4057-the-target-getresolvedwinmd-does-not-exist-in-the-project/11668 "2024-09-13T12:45:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [September 13, 2024, 12:45pm UTC](https://discourse.cmake.org/t/error-msb4057-the-target-getresolvedwinmd-does-not-exist-in-the-project/11668/1 "2024-09-13T12:45:03Z")

</div>

Our tools are `cmake v3.25.2` and `MSBuild-Version 17.11.2+c078802d4` für .NET Framework  
Microsoft `Visual Studio Professional 2022 (64-bit) - Current Version 17.11.2`  
on Windows 11

We create a `visual studio 2022` project with this options:

```cmd
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"

cmake -G "Visual Studio 17 2022" -B build -S . -A Win32 -D CMAKE_GENERATOR_TOOLSET=v100 -D BUILD_TESTS=YES -D BUILD_TOOLS=YES -D BUILD_TESTS_REMOTE=YES -D BUILD_SHARPTEST=YES -D CMAKE_CONFIGURATION_TYPES=Release # or Debug only! CK

```

Or with this cmake Preset (from cmd or with cmake-gui)

```json
{
    "version": 6,
    "cmakeMinimumRequired": {
        "major": 3,
        "minor": 25,
        "patch": 0
    },
    "configurePresets": [
        {
            "name": "Ninja_Debug",
            "displayName": "Windows Debug only configuration",
            "description": "This preset is only available on Windows",
            "condition": {
                "type": "equals",
                "lhs": "${hostSystemName}",
                "rhs": "Windows"
            },
            "binaryDir": "${sourceDir}/build",
            "installDir": "${sourceDir}/stagedir",
            "generator": "Ninja",
            "cacheVariables": {
                "CMAKE_PREFIX_PATH": {
                    "type": "path",
                    "value": "${sourceDir}/stagedir"
                },
                "BUILD_LONG_RUNNING_TESTS": true,
                "BUILD_SHARED_LIBS": false,
                "BUILD_TESTS": true,
                "CMAKE_BUILD_TYPE": "Debug",
                "CMAKE_CONFIGURATION_TYPES": "Debug",
                "CMAKE_CXX_COMPILER": "cl",
                "CMAKE_CXX_EXTENSIONS": false,
                "CMAKE_CXX_STANDARD": "11",
                "CMAKE_CXX_STANDARD_REQUIRED": true,
                "CMAKE_C_COMPILER": "cl",
                "CMAKE_DEBUG_POSTFIX": "D",
                "CMAKE_INSTALL_MESSAGE": "LAZY",
                "CMAKE_RUNTIME_OUTPUT_DIRECTORY": "${sourceDir}/build/bin",
                "CMAKE_UNITY_BUILD": false
            },
            "environment": {
                "CMAKE_EXPORT_COMPILE_COMMANDS": "YES",
                "CTEST_OUTPUT_ON_FAILURE": "YES",
                "CTEST_PARALLEL_LEVEL": "1",
                "CPM_USE_LOCAL_PACKAGES": "YES"
            },
            "warnings": {
                "deprecated": true,
                "uninitialized": false
            }
        },
        {
            "name": "Release",
            "inherits": "Ninja_Debug",
            "displayName": "Windows Release only configuration",
            "description": "This preset is only available on Windows",
            "condition": {
                "type": "equals",
                "lhs": "${hostSystemName}",
                "rhs": "Windows"
            },
            "generator": "Visual Studio 17 2022",
            "architecture": "Win32",
            "toolset": "v100",
            "cacheVariables": {
                "BUILD_TESTS": false,
                "CMAKE_CONFIGURATION_TYPES": "Release",
                "CMAKE_BUILD_TYPE": "Release"
            },
            "vendor": {
                "microsoft.com/VisualStudioSettings/CMake/1.0": {
                    "clangTidyChecks":
                            "-*, bugprone-*, cert-*, misc-*, -misc-const-correctness, -misc-include-cleaner, -modernize-*, -readability-*, performance-*, portability-*, concurrency-*",
                    "enableMicrosoftCodeAnalysis": true,
                    "enableClangTidyCodeAnalysis": true
                }
            }
        }
    ]
# ...
}

```

If we open the generated solution and start the build, wie get error for each target?

But if we open with `vs2022` the project folder directly, our Release preset is loaded and it works fine!

---

<div class="post-metadata">

### Author: ![hsattler](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/h/59ef9b/32.png) [@hsattler](https://discourse.cmake.org/u/hsattler)
#### Post date: [September 13, 2024, 4:13pm UTC](https://discourse.cmake.org/t/error-msb4057-the-target-getresolvedwinmd-does-not-exist-in-the-project/11668/2 "2024-09-13T16:13:21Z")

</div>

> [@ClausKlein](#):
>
> We create a `visual studio 2022` project with this options:
> 
> ```auto
> call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"
> 
> cmake -G "Visual Studio 12 2013" -B build -S . -A Win32 -D CMAKE_GENERATOR_TOOLSET=v100 -D BUILD_TESTS=YES -D BUILD_TOOLS=YES -D BUILD_TESTS_REMOTE=YES -D BUILD_SHARPTEST=YES -D CMAKE_CONFIGURATION_TYPES=Release # or Debug only! CK
> 
> ```

You say you want VS 2022, call vcvars for VS 2010 and then generate for VS 2013?

At least for Ninja, you should call vcvars from VS 2013 with proper arguments for the wanted toolset and maybe SDK.

Will probably not solve the error message though 🙊

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [September 13, 2024, 6:19pm UTC](https://discourse.cmake.org/t/error-msb4057-the-target-getresolvedwinmd-does-not-exist-in-the-project/11668/3 "2024-09-13T18:19:01Z")

</div>

Good catch, a copy and past failure of me, sorry

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [October 9, 2024, 7:05pm UTC](https://discourse.cmake.org/t/error-msb4057-the-target-getresolvedwinmd-does-not-exist-in-the-project/11668/4 "2024-10-09T19:05:16Z")

</div>

### Fixed In: Visual Studio 2022 version 17.11.5

see too MS [Developer Community](https://developercommunity.visualstudio.com/t/Error-MSB4057-in-Visual-Studio-2022-171/10722469)
