Skip to content

Commit a05fbd7

Browse files
Merge pull request #13825 from GitHubber17/415544-e
410544 - MSBuild error article updates
2 parents f6df49d + 16500a6 commit a05fbd7

File tree

10 files changed

+210
-88
lines changed

10 files changed

+210
-88
lines changed

docs/msbuild/errors/msb3721.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: "MSB3721: The command 'command' exited with code 'error-code'"
3-
description: "This error occurs when a command launched in the build process exits with a non-zero error code."
4-
ms.date: "04/30/2021"
2+
title: MSB3721 diagnostic code
3+
description: Learn about the possible causes of the MSB3721 build error and get troubleshooting tips.
4+
ms.date: 04/15/2025
55
ms.topic: "error-reference"
66
f1_keywords:
77
- MSB3721
@@ -16,14 +16,30 @@ ms.author: ghogen
1616
manager: mijacobs
1717
ms.subservice: msbuild
1818
---
19-
# MSB3721: The command 'command' exited with code 'error-code'
19+
# MSB3721
2020

21-
This error occurs when a command launched in the build process exits with a non-zero error code.
21+
This article describes the MSB3721 error code.
2222

23-
To investigate the error, check the build output or build log to see if the custom build step produced an error with information about the problem. If not, try running it separately to check for any problems or unexpected behavior.
23+
## Message text
2424

25-
If you can't see the exact command-line that failed, you can change the verbosity of the build output to show more detail. The MSBuild command-line option is `-verbosity:{level}` or `-V:{level}`, where `{level}` is one of `q[uiet]`, `m[inimal]`, `n[ormal]` (the default), `d[etailed]`, or `diag[nostic]`. See [MSBuild command line reference](../msbuild-command-line-reference.md). For bigger output logs on large projects, consider using the binary log (`-bl` command-line switch) and the [MSBuild Structured Log Viewer](https://msbuildlog.com/) to view the output more easily.
25+
`MSB3721: The command 'command' exited with code 'error-code'.`
2626

27-
You can also set the `MSBuildDebugEngine` environment variable to 1 to get all possible logs. See [Building MSBuild for the .NET Framework - Logs](https://github.com/dotnet/msbuild/blob/main/documentation/wiki/Building-Testing-and-Debugging-on-Full-Framework-MSBuild.md#logs).
27+
## Description
2828

29-
In Visual Studio, you can change the verbosity in **Tools** > **Options**, **Projects and Solutions**, **Build and Run**. See [How to: View, save, and configure build log files](../../ide/how-to-view-save-and-configure-build-log-files.md#specify-data-verbosity-for-build-logs).
29+
This error occurs when a command launched in the build process exits with a nonzero error code.
30+
31+
## Resolution
32+
33+
Check the build output or build log to see if the custom build step produced an error with information about the problem. If not, try running the step separately to check for any problems or unexpected behavior.
34+
35+
If you can't see the exact command-line that failed, you can change the verbosity of the build output to show more detail.
36+
37+
The MSBuild command-line option is `-verbosity:{level}` or `-V:{level}`, where `{level}` is one of `q[uiet]`, `m[inimal]`, `n[ormal]` (the default), `d[etailed]`, or `diag[nostic]`. For more information, see [MSBuild command line reference](../msbuild-command-line-reference.md). For longer output logs on large projects, consider using the binary log `-bl` command-line switch with the [MSBuild Structured Log Viewer](https://msbuildlog.com/) to view the output more easily.
38+
39+
You can also set the `MSBuildDebugEngine` environment variable to 1 to get all possible logs. For more information, see [Building MSBuild for the .NET Framework - Logs](https://github.com/dotnet/msbuild/blob/main/documentation/wiki/Building-Testing-and-Debugging-on-Full-Framework-MSBuild.md#logs).
40+
41+
In Visual Studio, you can change the verbosity in **Tools** > **Options**, **Projects and Solutions**, **Build and Run**. For more information, see [View, save, and configure build log files](../../ide/how-to-view-save-and-configure-build-log-files.md#specify-data-verbosity-for-build-logs).
42+
43+
## Applies to
44+
45+
All versions of MSBuild

docs/msbuild/errors/msb3774.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: "MSB3774: The SDK 'name' specified could not be found."
3-
description: "This error occurs when MSBuild couldn't find the SDK referenced in the project file."
4-
ms.date: "08/15/2022"
2+
title: MSB3774 diagnostic code
3+
description: Learn about the possible causes of the MSB3774 build error and get troubleshooting tips.
4+
ms.date: 04/15/2025
55
ms.topic: "error-reference"
66
f1_keywords:
77
- MSB3774
@@ -18,10 +18,24 @@ ms.subservice: msbuild
1818
---
1919
# MSB3774
2020

21-
This error occurs when MSBuild can't find the SDK referenced in the project file. MSBuild relies on user-extensible SDK resolvers to find SDKs. You get this error when a configured resolver could not find the requested SDK.
21+
This article describes the MSB3774 error code.
2222

23-
Check the project file and locate the root Project element, and check its `Sdk` attribute. For .NET projects, this value should be `Microsoft.NET.Sdk` or for NuGet, check the spelling of the package or feed name, and version number, and that the referenced NuGet feed is accessible or publicly available.
23+
## Message text
2424

25-
Check that the SDK is installed correctly. Check with the SDK provider to make sure that you are using the right name to reference the SDK.
25+
`MSB3774: The SDK 'name' specified could not be found.`
2626

27-
See [How to use Project SDK](../how-to-use-project-sdk.md).
27+
## Description
28+
29+
This error occurs when MSBuild can't find the SDK referenced in the project file. MSBuild relies on user-extensible SDK resolvers to find SDKs. You get this error when a configured resolver can't find the requested SDK.
30+
31+
## Resolution
32+
33+
In your project file, check the root `Project` element and the `Sdk` attribute. For .NET projects, the attribute value should be `Microsoft.NET.Sdk` or a reference for NuGet. Check the spelling of the package or feed name, and the version number. Confirm the referenced NuGet feed is accessible or publicly available.
34+
35+
Verify that the SDK is installed correctly. Check with the SDK provider to make sure you're using the correct name to reference the SDK.
36+
37+
For more information, see [How to use Project SDK](../how-to-use-project-sdk.md).
38+
39+
## Applies to
40+
41+
All versions of MSBuild

docs/msbuild/errors/msb3821.md

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: "MSB3821: Couldn't process file 'path' due to its being in the Internet or Restricted zone or having the mark of the web on the file"
3-
description: "This error occurs when MSBuild attempts to process a file downloaded from the web with security restrictions."
4-
ms.date: "04/30/2021"
2+
title: MSB3821 diagnostic code
3+
description: Learn about the possible causes of the MSB3821 build error and get troubleshooting tips.
4+
ms.date: 04/15/2025
55
ms.topic: "error-reference"
66
f1_keywords:
77
- MSB3821
@@ -16,23 +16,36 @@ ms.author: ghogen
1616
manager: mijacobs
1717
ms.subservice: msbuild
1818
---
19-
# MSB3821: Couldn't process file 'path' due to its being in the Internet or Restricted zone or having the mark of the web on the file
19+
# MSB3821
2020

21-
This error occurs when MSBuild attempts to process a file downloaded from the web (or a cloud drive) with security restrictions.
21+
This article describes the MSB3821 error code.
2222

23-
When you download web assets such as HTML pages to a Windows device using a browser, the browser inserts a marker called the *mark of the web*, which records the security zone of the site from which the page originated. This is intended to protect from potentially malicious pages and enforce the security level on the original site, even after a page from the site is downloaded. This security check is required due to this security issue: [Visual Studio Remote Code Execution Vulnerability CVE-2018-8172](https://msrc.microsoft.com/update-guide/vulnerability/CVE-2018-8172).
23+
## Message text
2424

25-
MSBuild respects this security restriction, but if you decide that you trust the content in question, but you can override the restriction by unblocking a single file from File Explorer (open the **Properties** window on the file, and check **Unblock**). To unblock multiple files using a PowerShell script, use the [Unblock-File](/powershell/module/microsoft.powershell.utility/unblock-file) cmdlet.
25+
`MSB3821: Couldn't process file 'path' due to its being in the Internet or Restricted zone or having the mark of the web on the file.
26+
Remove the mark of the web if you want to process these files.`
2627

27-
The full message is similar to the following text:
28+
## Description
2829

29-
```output
30-
Couldn't process file 'path' due to its being in the Internet or Restricted zone or having the mark of the web on the file.
31-
Remove the mark of the web if you want to process these files.
32-
```
30+
This error occurs when MSBuild attempts to process a file downloaded from the web (or a cloud drive) that has security restrictions.
3331

34-
Visual Studio also includes security restrictions that detect the mark of the web comment. You can customize these settings in the **Tools** > **Options** section **Trust Settings**. See [Configure trust settings for files and folders](../../ide/reference/trust-settings.md).
32+
When you download web assets like HTML pages to a Windows device by using a browser, the browser inserts a marker called the *mark of the web*, which records the security zone of the site from which the page originated. The mark is intended to help protect from potentially malicious pages and enforce the security level on the original site, even after a page from the site is downloaded. This security check is required due to a specific security issue: [Visual Studio remote code execution vulnerability CVE-2018-8172](https://msrc.microsoft.com/update-guide/vulnerability/CVE-2018-8172).
3533

36-
If you can't fix the error directly in Visual Studio, then close Visual Studio, go to the projects folder in File Explorer, open the **Properties menu** of the file that's giving you the error (keyboard: **Alt** + **Enter**), check the checkbox with the label **Unblock**, then click **Apply** and close the window. When you reopen Visual Studio and open your project, try building again.
34+
## Resolution
3735

38-
From PowerShell, you can use the command [Unblock-File](/powershell/module/microsoft.powershell.utility/unblock-file).
36+
If you decide to trust the content in question, you can override the restriction by unblocking a single file from File Explorer. Open the **Properties** window on the file, and select **Unblock**. You can also unblock multiple files with a PowerShell script and the [Unblock-File](/powershell/module/microsoft.powershell.utility/unblock-file) cmdlet.
37+
38+
Visual Studio also includes security restrictions that detect the *mark of the web* comment. You can customize these settings in the **Tools** > **Options** section **Trust Settings**. For more information, see [Configure trust settings for files and folders](../../ide/reference/trust-settings.md).
39+
40+
In some cases, you can't fix the error directly in Visual Studio. Instead, follow this procedure:
41+
42+
1. Close Visual Studio.
43+
1. In File Explorer, go to the project folder.
44+
1. Locate the file that has the MSB3821 error and open the **Properties menu** (**Alt** + **Enter**).
45+
1. Select the **Unblock** checkbox, and then select **Apply**.
46+
1. Close the window.
47+
1. Restart Visual Studio. Open your project, and build the project again.
48+
49+
## Applies to
50+
51+
All versions of MSBuild

docs/msbuild/errors/msb3822.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: "MSB3822"
3-
description: "Non-string resources require the System.Resources.Extensions assembly at runtime, but it was not found in this project's references."
4-
ms.date: "06/18/2021"
2+
title: MSB3822 diagnostic code
3+
description: Learn about the possible causes of the MSB3822 build error and get troubleshooting tips.
4+
ms.date: 04/15/2025
55
ms.topic: "error-reference"
66
f1_keywords:
77
- MSB3822
@@ -16,10 +16,24 @@ ms.author: ghogen
1616
manager: mijacobs
1717
ms.subservice: msbuild
1818
---
19-
# MSB3822: Non-string resources require the System.Resources.Extensions assembly at runtime, but it was not found in this project's references
19+
# MSB3822
2020

21-
This error occurs when the project file opts into embedding resources using the new `System.Resources.Extensions` mechanism, which is not compatible with old .NET Framework project types unless `System.Resources.Extensions.dll` is available at runtime.
21+
This article describes the MSB3822 error code.
2222

23-
To resolve this issue, either reference the `System.Resources.Extensions` package, or use the default resource-embedding process (do not specify `GenerateResourceUsePreserializedResources`).
23+
## Message text
2424

25-
When running on .NET Core or .NET 5.0 or higher, MSBuild supports *only* the new resource-embedding technique. If you wish to use the old default process, you must build with MSBuild.exe or Visual Studio and cannot use `dotnet build`.
25+
`MSB3822: Non-string resources require the System.Resources.Extensions assembly at runtime, but it was not found in this project's references.`
26+
27+
## Description
28+
29+
This error occurs when the project file opts into embedding resources by using the new `System.Resources.Extensions` mechanism. This mechanism isn't compatible with older .NET Framework project types unless the `System.Resources.Extensions.dll` library is available at runtime.
30+
31+
## Resolution
32+
33+
To resolve this issue, you can reference the `System.Resources.Extensions` package, or use the default resource-embedding process (don't specify the `GenerateResourceUsePreserializedResources` option).
34+
35+
When you run on .NET Core or .NET 5.0 or higher, MSBuild supports *only* the new resource-embedding technique. If you want to use the old default process, you must build with MSBuild.exe or Visual Studio and can't use the `dotnet build` command.
36+
37+
## Applies to
38+
39+
All versions of MSBuild

docs/msbuild/errors/msb3836.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: "MSB3836"
3-
description: "The explicit binding redirect on 'assembly' conflicts with an autogenerated binding redirect. Consider removing it from the application configuration file or disabling autogenerated binding redirects. The build will replace it with: 'binding-redirect'."
4-
ms.date: "07/07/2021"
2+
title: MSB3836 diagnostic code
3+
description: Learn about the possible causes of the MSB3836 build error and get troubleshooting tips.
4+
ms.date: 04/15/2025
55
ms.topic: "error-reference"
66
f1_keywords:
77
- MSB3836
@@ -18,10 +18,22 @@ ms.subservice: msbuild
1818
---
1919
# MSB3836
2020

21-
This error occurs when you explicitly specify a binding redirect, but a conflicting binding redirect was already automatically generated for that assembly.
21+
This article describes the MSB3836 error code.
2222

23-
Learn more about binding redirects at [Redirect assembly versions](/dotnet/framework/configure-apps/redirect-assembly-versions).
23+
## Message text
2424

25-
Check for a [bindingredirect element](/dotnet/framework/configure-apps/file-schema/runtime/bindingredirect-element) in the application configuration file (for example, *app.config*) to check if your code explicitly specifies a binding redirect.
25+
`MSB3836: The explicit binding redirect on 'assembly' conflicts with an autogenerated binding redirect. Consider removing it from the application configuration file or disabling autogenerated binding redirects. The build will replace it with: 'binding-redirect'.`
2626

27-
To disable autogenerated binding redirects, see [How to: Enable or disable automatic binding redirection](/dotnet/framework/configure-apps/how-to-enable-and-disable-automatic-binding-redirection).
27+
## Description
28+
29+
This error occurs when you explicitly specify a binding redirect, but a conflicting binding redirect is already automatically generated for the assembly. For more information about binding redirects, see [Redirect assembly versions](/dotnet/framework/configure-apps/redirect-assembly-versions).
30+
31+
## Resolution
32+
33+
Look for a [bindingredirect element](/dotnet/framework/configure-apps/file-schema/runtime/bindingredirect-element) in the application configuration file (for example, *app.config*). The presence of this element can help you determine if your code explicitly specifies a binding redirect.
34+
35+
To disable autogenerated binding redirects, see [Enable or disable automatic binding redirection](/dotnet/framework/configure-apps/how-to-enable-and-disable-automatic-binding-redirection).
36+
37+
## Applies to
38+
39+
All versions of MSBuild

docs/msbuild/errors/msb3884.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: "MSB3884: Could not find rule set file 'filename'."
3-
description: "This error occurs when MSBuild couldn't find a ruleset file needed by Code Analysis."
4-
ms.date: "07/07/2021"
2+
title: MSB3884 diagnostic code
3+
description: Learn about the possible causes of the MSB3884 build error and get troubleshooting tips.
4+
ms.date: 04/15/2025
55
ms.topic: "error-reference"
66
f1_keywords:
77
- MSB3884
@@ -16,8 +16,22 @@ ms.author: ghogen
1616
manager: mijacobs
1717
ms.subservice: msbuild
1818
---
19-
# MSB3884: Could not find rule set file 'filename'
19+
# MSB3884
2020

21-
This error occurs when MSBuild couldn't find a ruleset file needed by Code Analysis. Code Analysis uses ruleset files that determine which rules are active. Ensure that the specified file exists and your MSBuild process has the right permissions to read it.
21+
This article describes the MSB3884 error code.
2222

23-
See [Using rule sets to group code analysis rules](../../code-quality/using-rule-sets-to-group-code-analysis-rules.md).
23+
## Message text
24+
25+
`MSB3884: Could not find rule set file 'filename'.`
26+
27+
## Description
28+
29+
This error occurs when MSBuild can't find a ruleset file required for Code Analysis. Code Analysis uses ruleset files to determine which rules are active.
30+
31+
## Resolution
32+
33+
Verify the specified file exists. Confirm your MSBuild process can read the file (correct access permissions). For more information, see [Use rule sets to group code analysis rules](../../code-quality/using-rule-sets-to-group-code-analysis-rules.md).
34+
35+
## Applies to
36+
37+
All versions of MSBuild

docs/msbuild/errors/msb3971.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: "MSB3971"
3-
description: "The reference assemblies for 'framework-version' were not found. You might be using an older .NET SDK to target .NET 5.0 or higher. Update Visual Studio and/or your .NET SDK."
4-
ms.date: 2/5/2025
2+
title: MSB3971 diagnostic code
3+
description: Learn about the possible causes of the MSB3971 build error and get troubleshooting tips.
4+
ms.date: 04/15/2025
55
ms.topic: "error-reference"
66
f1_keywords:
77
- MSB3971
@@ -16,12 +16,22 @@ ms.author: ghogen
1616
manager: mijacobs
1717
ms.subservice: msbuild
1818
---
19-
# MSB3971 diagnostic code
19+
# MSB3971
2020

21-
The full error is:
21+
This article describes the MSB3971 error code.
2222

23-
```output
24-
The reference assemblies for 'framework-version' were not found. You might be using an older .NET SDK to target .NET 5.0 or higher. Update Visual Studio and/or your .NET SDK.
25-
```
23+
## Message text
2624

27-
This error occurs when you're building for .NET 5 or later, but you're using an older version of the .NET SDK. This issue can usually be resolved by upgrading to a newer version of your build tools. To install a newer version of the .NET SDK, see [Download .NET](https://dotnet.microsoft.com/download).
25+
`MSB3971: The reference assemblies for 'framework-version' were not found. You might be using an older .NET SDK to target .NET 5.0 or higher. Update Visual Studio and/or your .NET SDK.`
26+
27+
## Description
28+
29+
This error occurs when you're building for .NET 5 or later, but you're using an older version of the .NET SDK.
30+
31+
## Resolution
32+
33+
This issue can usually be resolved by upgrading to a newer version of your build tools. To install a newer version of the .NET SDK, see [Download .NET](https://dotnet.microsoft.com/download).
34+
35+
## Applies to
36+
37+
All versions of MSBuild

0 commit comments

Comments
 (0)