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
Copy file name to clipboardExpand all lines: docs/core/tools/sdk-errors/index.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,6 @@ f1_keywords:
29
29
- NETSDK1029
30
30
- NETSDK1030
31
31
- NETSDK1031
32
-
- NETSDK1032
33
32
- NETSDK1042
34
33
- NETSDK1043
35
34
- NETSDK1044
@@ -110,7 +109,6 @@ f1_keywords:
110
109
- NETSDK1140
111
110
- NETSDK1142
112
111
- NETSDK1143
113
-
- NETSDK1144
114
112
- NETSDK1146
115
113
- NETSDK1148
116
114
- NETSDK1150
@@ -208,7 +206,7 @@ This list is a complete list of the errors that you might get from the .NET SDK
208
206
|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.|
209
207
|NETSDK1030|Given file name '{0}' is longer than 1024 bytes.|
210
208
|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.|
211
-
|NETSDK1032|The RuntimeIdentifier platform '{0}' and the PlatformTarget '{1}' must be compatible.|
209
+
|[NETSDK1032](netsdk1032.md)|The RuntimeIdentifier platform '{0}' and the PlatformTarget '{1}' must be compatible.|
212
210
|NETSDK1042|Could not load PlatformManifest from '{0}' because it did not exist.|
213
211
|NETSDK1043|Error parsing PlatformManifest from '{0}' line {1}. Lines must have the format {2}.|
214
212
|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
307
305
|[NETSDK1141](netsdk1141.md)|Unable to resolve the .NET SDK version as specified in the global.json located at {0}.|
308
306
|NETSDK1142|Including symbols in a single file bundle is not supported when publishing for .NET5 or higher.|
309
307
|NETSDK1143|Including all content in a single file bundle also includes native libraries. If IncludeAllContentForSelfExtract is true, IncludeNativeLibrariesForSelfExtract must not be false.|
310
-
|NETSDK1144|Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false.|
308
+
|[NETSDK1144](netsdk1144.md)|Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false.|
311
309
|[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 <https://aka.ms/targeting-apphost-pack-missing>. Pack Type:{0}, Pack directory: {1}, targetframework: {2}, Pack PackageId: {3}, Pack Package Version: {4}.|
312
310
|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.|
313
311
|[NETSDK1147](netsdk1147.md)|To build this project, the following workloads must be installed: {0}.|
title: "NETSDK1032: RuntimeIdentifier and PlatformTarget must be compatible."
3
+
description: How to resolve the NETSDK1032 error 'RuntimeIdentifier and PlatformTarget must be compatible.'
4
+
author: tdykstra
5
+
ms.topic: error-reference
6
+
ms.date: 01/14/2025
7
+
ai-usage: ai-assisted
8
+
f1_keywords:
9
+
- NETSDK1032
10
+
---
11
+
# NETSDK1032: RuntimeIdentifier and PlatformTarget must be compatible
12
+
13
+
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:
14
+
15
+
> The `RuntimeIdentifier` platform '{RID}' and the `PlatformTarget` '{Target}' must be compatible.
16
+
17
+
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.
18
+
19
+
The `PlatformTarget` is specified in the project file or the command line. If not specified, the default is `AnyCPU`.
20
+
21
+
Here's an example of a `.csproj` file with incompatible RID and `PlatformTarget` settings:
22
+
23
+
```xml
24
+
<ProjectSdk="Microsoft.NET.Sdk">
25
+
<PropertyGroup>
26
+
<OutputType>Exe</OutputType>
27
+
<TargetFramework>net8.0</TargetFramework>
28
+
<PlatformTarget>x86</PlatformTarget>
29
+
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
30
+
</PropertyGroup>
31
+
</Project>
32
+
```
33
+
34
+
Fix the preceding `.csproj` file by changing either `PlatformTarget` or `RuntimeIdentifier`. For example, change `PlatformTarget` to match the RID:
0 commit comments