diff --git a/docs/core/tools/sdk-errors/index.md b/docs/core/tools/sdk-errors/index.md index 091d20c6f2539..2503ee2c236c2 100644 --- a/docs/core/tools/sdk-errors/index.md +++ b/docs/core/tools/sdk-errors/index.md @@ -29,7 +29,6 @@ f1_keywords: - NETSDK1029 - NETSDK1030 - NETSDK1031 -- NETSDK1032 - NETSDK1042 - NETSDK1043 - NETSDK1044 @@ -110,7 +109,6 @@ f1_keywords: - NETSDK1140 - NETSDK1142 - NETSDK1143 -- NETSDK1144 - NETSDK1146 - NETSDK1148 - NETSDK1150 @@ -208,7 +206,7 @@ This list is a complete list of the errors that you might get from the .NET SDK |NETSDK1029|Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.| |NETSDK1030|Given file name '{0}' is longer than 1024 bytes.| |NETSDK1031|It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. You must either specify a RuntimeIdentifier or set SelfContained to false.| -|NETSDK1032|The RuntimeIdentifier platform '{0}' and the PlatformTarget '{1}' must be compatible.| +|[NETSDK1032](netsdk1032.md)|The RuntimeIdentifier platform '{0}' and the PlatformTarget '{1}' must be compatible.| |NETSDK1042|Could not load PlatformManifest from '{0}' because it did not exist.| |NETSDK1043|Error parsing PlatformManifest from '{0}' line {1}. Lines must have the format {2}.| |NETSDK1044|Error parsing PlatformManifest from '{0}' line {1}. {2} '{3}' was invalid.| @@ -307,7 +305,7 @@ This list is a complete list of the errors that you might get from the .NET SDK |[NETSDK1141](netsdk1141.md)|Unable to resolve the .NET SDK version as specified in the global.json located at {0}.| |NETSDK1142|Including symbols in a single file bundle is not supported when publishing for .NET5 or higher.| |NETSDK1143|Including all content in a single file bundle also includes native libraries. If IncludeAllContentForSelfExtract is true, IncludeNativeLibrariesForSelfExtract must not be false.| -|NETSDK1144|Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false.| +|[NETSDK1144](netsdk1144.md)|Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false.| |[NETSDK1145](netsdk1145.md)|The {0} pack is not installed and NuGet package restore is not supported. Upgrade Visual Studio, remove global.json if it specifies a certain SDK version, and uninstall the newer SDK. For more options visit . Pack Type:{0}, Pack directory: {1}, targetframework: {2}, Pack PackageId: {3}, Pack Package Version: {4}.| |NETSDK1146|PackAsTool does not support TargetPlatformIdentifier being set. For example, TargetFramework cannot be net5.0-windows, only net5.0. PackAsTool also does not support UseWPF or UseWindowsForms when targeting .NET 5 and higher.| |[NETSDK1147](netsdk1147.md)|To build this project, the following workloads must be installed: {0}.| diff --git a/docs/core/tools/sdk-errors/netsdk1032.md b/docs/core/tools/sdk-errors/netsdk1032.md new file mode 100644 index 0000000000000..0d2e156f54f06 --- /dev/null +++ b/docs/core/tools/sdk-errors/netsdk1032.md @@ -0,0 +1,58 @@ +--- +title: "NETSDK1032: RuntimeIdentifier and PlatformTarget must be compatible." +description: How to resolve the NETSDK1032 error 'RuntimeIdentifier and PlatformTarget must be compatible.' +author: tdykstra +ms.topic: error-reference +ms.date: 01/14/2025 +ai-usage: ai-assisted +f1_keywords: +- NETSDK1032 +--- +# NETSDK1032: RuntimeIdentifier and PlatformTarget must be compatible + +The error `NETSDK1032` occurs when there's a mismatch between the `RuntimeIdentifier` (RID), such as `win-x64` or `linux-x64`, and the `PlatformTarget`, such as `x64` or `x86`. The full error message is similar to the following example: + +> The `RuntimeIdentifier` platform '{RID}' and the `PlatformTarget` '{Target}' must be compatible. + +The RID is specified in the project file or the command line. If not specified, the default RID used is `win-x64` for Windows, `linux-x64` for Linux, and `osx-x64` for macOS. + +The `PlatformTarget` is specified in the project file or the command line. If not specified, the default is `AnyCPU`. + +Here's an example of a `.csproj` file with incompatible RID and `PlatformTarget` settings: + +```xml + + + Exe + net8.0 + x86 + win-x64 + + +``` + +Fix the preceding `.csproj` file by changing either `PlatformTarget` or `RuntimeIdentifier`. For example, change `PlatformTarget` to match the RID: + +```xml + + + Exe + net8.0 + x64 + win-x64 + + +``` + +Or change the RID to match the `PlatformTarget`: + +```xml + + + Exe + net8.0 + x86 + win-x86 + + +``` diff --git a/docs/core/tools/sdk-errors/netsdk1144.md b/docs/core/tools/sdk-errors/netsdk1144.md new file mode 100644 index 0000000000000..f9716a85821d5 --- /dev/null +++ b/docs/core/tools/sdk-errors/netsdk1144.md @@ -0,0 +1,42 @@ +--- +title: "NETSDK1144: Optimizing assemblies for size failed" +description: How to resolve the 'optimizing for size failed' message. +author: tdykstra +ms.topic: error-reference +ms.date: 01/14/2025 +ai-usage: ai-assisted +f1_keywords: +- NETSDK1144 +--- +# NETSDK1144: Optimizing assemblies for size failed + +## Error Message + +The error `NETSDK1144` is reported when an error occurs in the trimming process. The full error message is similar to the following example: + +> Optimizing assemblies for size failed. Optimization can be disabled by setting the `PublishTrimmed` property to false. + +To disable trimming, set the `PublishTrimmed` property to `false` in the project file or the command line: + + ```xml + + false + + ``` + + ```dotnetcli + dotnet publish /p:PublishTrimmed=false + ``` + +Here's an example of a `.csproj` file with trimming disabled: + +```xml + + + Exe + net8.0 + linux-arm + false + + +``` diff --git a/docs/navigate/tools-diagnostics/toc.yml b/docs/navigate/tools-diagnostics/toc.yml index 33f7ed0c9aa30..498a62b03f9f1 100644 --- a/docs/navigate/tools-diagnostics/toc.yml +++ b/docs/navigate/tools-diagnostics/toc.yml @@ -33,6 +33,8 @@ items: href: ../../core/tools/sdk-errors/netsdk1013.md - name: NETSDK1022 href: ../../core/tools/sdk-errors/netsdk1022.md + - name: NETSDK1032 + href: ../../core/tools/sdk-errors/netsdk1032.md - name: NETSDK1045 href: ../../core/tools/sdk-errors/netsdk1045.md - name: NETSDK1059 @@ -67,6 +69,8 @@ items: href: ../../core/tools/sdk-errors/netsdk1138.md - name: NETSDK1141 href: ../../core/tools/sdk-errors/netsdk1141.md + - name: NETSDK1144 + href: ../../core/tools/sdk-errors/netsdk1144.md - name: NETSDK1145 href: ../../core/tools/sdk-errors/netsdk1145.md - name: NETSDK1147