You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: "MSBuild error MSB8024 occurs when the project can't use the static C++ runtime library."
4
-
ms.date: 10/29/2021
2
+
title: MSB8024 diagnostic code
3
+
description: Learn about the possible causes of the MSB8024 build error and get troubleshooting tips.
4
+
ms.date: 04/16/2025
5
5
ms.topic: "error-reference"
6
6
f1_keywords:
7
7
- MSB8024
@@ -12,10 +12,22 @@ ms.author: ghogen
12
12
manager: mijacobs
13
13
ms.subservice: msbuild
14
14
---
15
-
# MSBuild error MSB8024
15
+
# MSB8024
16
16
17
-
> MSB8024: Using static version of the C++ runtime library is not supported.
17
+
This article describes the MSB8024 error code.
18
18
19
-
When you specify the **`/MT`** or **`/MTd`** (Use multithreaded runtime library) linker options, you must use the dynamic library version of the Universal C Runtime Library (UCRT).
19
+
## Message text
20
20
21
-
To resolve this issue, modify the project to use the dynamic UCRT library. For more information, see [Upgrade your code to the Universal CRT](/cpp/porting/upgrade-your-code-to-the-universal-crt).
21
+
`MSB8024: Using static version of the C++ runtime library is not supported.`
22
+
23
+
## Description
24
+
25
+
This error occurs when the project can't use the static C++ runtime library. When you specify the **`/MT`** or **`/MTd`** (to use multithreaded runtime library) linker options, you must use the dynamic library version of the Universal C Runtime Library (UCRT).
26
+
27
+
## Resolution
28
+
29
+
Modify the project to use the dynamic UCRT library. For more information, see [Upgrade your code to the Universal CRT](/cpp/porting/upgrade-your-code-to-the-universal-crt).
description: "MSBuild warning MSB8027 occurs when two or more source files in your project have the same name."
4
-
ms.date: 05/27/2021
2
+
title: MSB8027 diagnostic code
3
+
description: Learn about the possible causes of the MSB8027 build error and get troubleshooting tips.
4
+
ms.date: 04/16/2025
5
5
ms.topic: "error-reference"
6
6
f1_keywords:
7
7
- MSB8027
@@ -12,14 +12,33 @@ ms.author: ghogen
12
12
manager: mijacobs
13
13
ms.subservice: msbuild
14
14
---
15
-
# MSBuild warning MSB8027
15
+
# MSB8027
16
16
17
-
> Two or more files with the name of *filename* will produce outputs to the same location. This can lead to an incorrect build result. The files involved are *file-path-1**file-path-2*.
17
+
This article describes the MSB8027 error code.
18
18
19
-
Two or more source files have the same name, and build results go to the same intermediate directory. The output of the file built first gets overwritten by the next file with the same name. The error is often followed by a `LNK4042` warning. This error can occur when you've combined projects that use the same filename in different locations.
19
+
## Message text
20
20
21
-
There are several ways to resolve this issue:
21
+
`MSB8027: Two or more files with the name of *filename* will produce outputs to the same location. This can lead to an incorrect build result. The files involved are *file-path-1* *file-path-2*.`
22
22
23
-
- If your project has two or more source files that have the same name, give the files unique names.
23
+
## Description
24
24
25
-
- If you can't change the file names, compile each file to a unique intermediate directory. To set the intermediate file location, select the source file in Solution Explorer, then right-click to open the shortcut menu. Choose **Properties** to open the **Property Pages** dialog for the source file. Select the **Configuration Properties** > **C/C++** > **Output Files** property page. Change the **Object File Name** property from `$(IntDir)` to `$(IntDir)%(RelativeDir)`. Choose **OK** to save your changes.
25
+
This error occurs when two or more source files have the same name, and build results go to the same intermediate directory. After the first file builds, the build overwrites output from the first file with output from the next file that has the same name.
26
+
27
+
The error output message is often followed by a `LNK4042` warning. This error can occur when you combine projects that use the same filename in different locations.
28
+
29
+
## Resolution
30
+
31
+
If your project has two or more source files that have the same name, give each file a unique name.
32
+
33
+
If you can't change the file names, compile each file to a unique intermediate directory.
34
+
35
+
To set the intermediate file location, follow these steps:
36
+
37
+
1. In **Solution Explorer**, right-click the source file, and select **Properties**.
38
+
1. In the **Property Pages** dialog for the source file, select the **Configuration Properties** > **C/C++** > **Output Files** property page.
39
+
1. Change the **Object File Name** property from `$(IntDir)` to `$(IntDir)%(RelativeDir)`.
description: "MSBuild warning MSB8028 occurs when two or more projects share outputs in the same intermediate directories."
4
-
ms.date: 11/01/2021
2
+
title: MSB8028 diagnostic code
3
+
description: Learn about the possible causes of the MSB8028 build error and get troubleshooting tips.
4
+
ms.date: 04/16/2025
5
5
ms.topic: "error-reference"
6
6
f1_keywords:
7
7
- MSB8028
@@ -12,14 +12,31 @@ ms.author: ghogen
12
12
manager: mijacobs
13
13
ms.subservice: msbuild
14
14
---
15
-
# MSBuild warning MSB8028
15
+
# MSB8028
16
16
17
-
> MSB8028: The intermediate directory (*shared-intermediate-path*) contains files shared from another project (*intermediate-path*). This can lead to incorrect clean and rebuild behavior.
17
+
This article describes the MSB8028 error code.
18
18
19
-
Two or more projects produce outputs to the same location. This issue can lead to an incorrect build result. The intermediate directories involved are *shared-intermediate-path* and *intermediate-path*.
19
+
## Message text
20
20
21
-
To resolve this issue:
21
+
`MSB8028: The intermediate directory (*shared-intermediate-path*) contains files shared from another project (*intermediate-path*). This can lead to incorrect clean and rebuild behavior.`
22
22
23
-
- For each project in your solution, set your `$(IntDir)` property for each supported configuration and platform to use its own unique directory. To set the intermediate file location, select the project in Solution Explorer, then right-click to open the shortcut menu. Choose **Properties** to open the **Property Pages** dialog for the project. Select the **Configuration Properties** > **C/C++** > **Output Files** property page. For each configuration in the project, set the **Intermediate Directory** property.
23
+
## Description
24
24
25
-
Note that `$(IntDir)` is an MSBuild property (macro) that applies to C++ build. See [Common macros for MSBuild commands and properties](/cpp/build/reference/common-macros-for-build-commands-and-properties).
25
+
This error occurs when two or more projects produce outputs to the same location. This issue can lead to an incorrect build result. The intermediate directories involved are *shared-intermediate-path* and *intermediate-path*.
26
+
27
+
## Resolution
28
+
29
+
For each project in your solution, set your `$(IntDir)` property for each supported configuration and platform, so it uses its own unique directory.
30
+
31
+
To set the intermediate file location, follow these steps:
32
+
33
+
1. In **Solution Explorer**, right-click the project node, and select **Properties**.
34
+
1. In the **Property Pages** dialog for the project, select the **Configuration Properties** > **C/C++** > **Output Files** property page.
35
+
1. For each configuration in the project, set the **Intermediate Directory** property.
36
+
1. Select **OK** to save your changes.
37
+
38
+
Keep in mind that `$(IntDir)` is an MSBuild property (macro) that applies to the C++ build process. For more information, see [Common macros for MSBuild commands and properties](/cpp/build/reference/common-macros-for-build-commands-and-properties).
description: "MSBuild warning MSB8029 occurs when intermediate or output directories are under the Temporary directory."
4
-
ms.date: 11/01/2021
2
+
title: MSB8029 diagnostic code
3
+
description: Learn about the possible causes of the MSB8029 build error and get troubleshooting tips.
4
+
ms.date: 04/16/2025
5
5
ms.topic: "error-reference"
6
6
f1_keywords:
7
7
- MSB8029
@@ -12,10 +12,29 @@ ms.author: ghogen
12
12
manager: mijacobs
13
13
ms.subservice: msbuild
14
14
---
15
-
# MSBuild warning MSB8029
15
+
# MSB8029
16
16
17
-
> MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build.
17
+
This article describes the MSB8029 error code.
18
18
19
-
To resolve this issue:
19
+
## Message text
20
20
21
-
- For each project in your solution, set your intermediate and output build directory properties for each supported configuration and platform to use a directory that's not under the Temporary directory. To set the directories, select the project in Solution Explorer, then right-click to open the shortcut menu. Choose **Properties** to open the **Property Pages** dialog for the project. Select the **Configuration Properties** > **C/C++** > **Output Files** property page. For each configuration in the project, set the **Intermediate Directory** and **Output Directory** property.
21
+
`MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build.`
22
+
23
+
## Description
24
+
25
+
This error occurs when the intermediate directory and output directory are located in the *Temporary* directory.
26
+
27
+
## Resolution
28
+
29
+
For each project in your solution, set your intermediate and output build directory properties for each supported configuration and platform to use a directory that's not under the *Temporary* directory.
30
+
31
+
To set the locations for the two directories, follow these steps:
32
+
33
+
1. In **Solution Explorer**, right-click the project node, and select **Properties**.
34
+
1. In the **Property Pages** dialog for the project, select the **Configuration Properties** > **C/C++** > **Output Files** property page.
35
+
1. For each configuration in the project, set the **Intermediate Directory** property and the **Output Directory** property.
description: "MSBuild error MSB8036 occurs when Visual Studio or MSBuild can't find the Windows SDK requested by your project in the expected location."
4
-
ms.date: "02/10/2021"
2
+
title: MSB8036 diagnostic code
3
+
description: Learn about the possible causes of the MSB8036 build error and get troubleshooting tips.
4
+
ms.date: 04/16/2025
5
5
ms.topic: "error-reference"
6
6
f1_keywords:
7
7
- MSB8036
@@ -12,28 +12,53 @@ ms.author: ghogen
12
12
manager: mijacobs
13
13
ms.subservice: msbuild
14
14
---
15
-
# MSBuild error MSB8036
15
+
# MSB8036
16
16
17
-
> The Windows SDK '*version*' was not found
17
+
This article describes the MSB8036 error code.
18
+
19
+
## Message text
20
+
21
+
`MSB8036: The Windows SDK *version* was not found.`
22
+
23
+
## Description
18
24
19
25
This error occurs when Visual Studio or MSBuild can't find the Windows SDK requested by your project in the expected location.
20
26
21
-
## Windows SDK version specified in project
27
+
## Resolution
28
+
29
+
The following sections describe options for resolving the MSB8036 error based on your configuration.
30
+
31
+
### Specify Windows SDK version for project in Visual Studio
32
+
33
+
If you build your project in Visual Studio, confirm the project targets the correct version of the Windows SDK:
22
34
23
-
If you're building your project in Visual Studio, the first thing to check is that the project targets the correct version of the Windows SDK. Right-click on the project node, and choose **Properties** or press **Alt**+**Enter**. The Property Pages dialog for your project appears. Under **Configuration Properties** > **General**, look for **Windows SDK Version**. For example, it might be **10 (latest installed version)**, which selects the most recent version if more than one version is installed. If you select the dropdown, you can see specific versions that Visual Studio has detected. Make sure that the version your project needs is selected.
35
+
1. In **Solution Explorer**, right-click the project node, and select **Properties** (**Alt**+**Enter**).
36
+
1. In the **Property Pages** dialog for your project, select the **Configuration Properties** > **General** property page.
37
+
1. Check the value for the **Windows SDK Version** property.
24
38
25
-
If you're using MSBuild directly, not with Visual Studio, you should check the places where the `WindowsTargetPlatformVersion` property might be set. It's usually in the project file, but it could also be in an imported file or in a global settings file such as *Directory.build.props*. This file can be located anywhere in the parent path to your project, up to the root of the drive. The default setting in a newly created project file looks like this:
39
+
The dropdown list of values shows the specific versions detected by Visual Studio. The value **10.0 (latest installed version)** instructs Visual Studio to always use the most recent SDK version, if multiple versions are installed.
40
+
41
+
1. Use the dropdown list to select the SDK version your project requires.
42
+
1. Select **OK** to save your changes.
43
+
44
+
### Use MSBuild directly without Visual Studio
45
+
46
+
If you use MSBuild directly without Visual Studio, check any place where the `WindowsTargetPlatformVersion` property might be set. The property is often set in the project file, but it might also be defined in an imported file or in a global settings file like *Directory.build.props*. The `.props` file can be located anywhere in the parent path to your project, up to the root of the drive. The following XML shows the default setting in a newly created project file:
Also, check build scripts or CI jobs that invoke MSBuild. Make sure the command line isn't passing an invalid value for this property.
32
53
33
-
## Install or reinstall the Windows SDK
54
+
### Install or reinstall the Windows SDK
55
+
56
+
If the previous options don't resolve the issue, install or reinstall the Windows SDK version your project needs.
57
+
58
+
You can install specific versions of the Windows SDK in the Visual Studio Installer by selecting the version in **Individual Components**. You can also download the Windows SDK from the [Windows Dev Center](https://developer.microsoft.com/windows/downloads/windows-sdk/).
34
59
35
-
If that doesn't resolve the issue, install or reinstall the Windows SDK version your project needs. You can install specific versions of the Windows SDK by using the Visual Studio Installer. Select the version in **Individual Components**. You can also download the Windows SDK from the [Windows Dev Center](https://developer.microsoft.com/windows/downloads/windows-sdk/).
60
+
For more information, see [Use the Windows 10 SDK in a Windows Desktop application](/cpp/windows/how-to-use-the-windows-10-sdk-in-a-windows-desktop-application).
36
61
37
-
## See also
62
+
## Applies to
38
63
39
-
-[How to: Use the Windows 10 SDK in a Windows Desktop application](/cpp/windows/how-to-use-the-windows-10-sdk-in-a-windows-desktop-application)
0 commit comments