-
Notifications
You must be signed in to change notification settings - Fork 6k
Document selected NETSDK error messages #30145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2335677
add netsdk1138
tdykstra 8710226
finish adding netsdk1138
tdykstra 32c81ad
add netsdk1082
tdykstra de16352
add netsdk1136
tdykstra 5118825
add netsdk1112
tdykstra 4595c40
add netsdk1137
tdykstra f1db905
add netsdk1182
tdykstra ae29df8
add netsdk1135
tdykstra 2710132
markdownlint
tdykstra 21df84c
add netsdk1100
tdykstra efe1138
edit pass, acrolinx
tdykstra ca5d0be
add info for 1182
tdykstra 7d924f7
apply note from Marc
tdykstra 4ee1f05
Apply suggestions from code review
tdykstra 0472cbe
address feedback
tdykstra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
title: "NETSDK1082: There was no runtime pack available" | ||
description: Learn about .NET SDK error NETSDK1082, which warns about an unavailable runtime pack for the specified RID. | ||
ms.topic: error-reference | ||
ms.date: 07/08/2022 | ||
f1_keywords: | ||
- NETSDK1082 | ||
--- | ||
# NETSDK1082: PackageReference to Microsoft.AspNetCore.App is not necessary | ||
|
||
NETSDK1082 warns you that the runtime pack for your [runtime identifier](../../rid-catalog.md) (RID) could not be found in your NuGet feed. The full error message is similar to the following example: | ||
|
||
>There was no runtime pack for \<RuntimePack> available for the specified RuntimeIdentifier '\<RID>'. | ||
|
||
.NET automatically downloads known runtime packs for self-contained applications but there could be a pointer to one that's not available to you. Investigate your NuGet configuration and feeds to find out why the required runtime pack is missing. In some scenarios, you might have to override the `LatestRuntimeFrameworkVersion` value to one that's available on your NuGet feeds by adding markup like the following example to the project file: | ||
|
||
```xml | ||
<ItemGroup> | ||
<KnownRuntimePack Update="@(KnownRuntimePack)"> | ||
<LatestRuntimeFrameworkVersion Condition="'%(TargetFramework)' == 'TARGETFRAMEWORK'">EXISTINGVERSION</LatestRuntimeFrameworkVersion> | ||
</KnownRuntimePack> | ||
</ItemGroup> | ||
``` | ||
|
||
In this example, TARGETFRAMEWORK represents values like `net6.0`, `net5.0`, or `netcoreapp3.1` -- basically anything that’s in the **NET 5+ (and .NET Core)** list in [Supported target frameworks](../../../standard/frameworks.md#supported-target-frameworks). EXISTINGVERSION would need to be a valid version that has been released. For example, `6.0.7` for `net6.0`, `5.0.17` for `net5.0`, and so forth. For information about released versions, see [Download .NET 6.0](https://dotnet.microsoft.com/download/dotnet/6.0) and [Download .NET 5.0](https://dotnet.microsoft.com/download/dotnet/5.0). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
title: "NETSDK1100: Set the `EnableWindowsTargeting` property to true" | ||
description: Learn about the .NET SDK error message that instructs you to set the EnableWindowsTargeting property to true. | ||
author: tdykstra | ||
ms.author: tdykstra | ||
ms.topic: error-reference | ||
ms.date: 07/08/2022 | ||
f1_keywords: | ||
- NETSDK1100 | ||
--- | ||
# NETSDK1100: Set the EnableWindowsTargeting property to true | ||
|
||
NETSDK1100 indicates that you're building a project that targets Windows on Linux or macOS. The full error message is similar to the following example: | ||
|
||
> To build a project targeting Windows on this operating system, set the `EnableWindowsTargeting` property to true. | ||
|
||
To resolve this error, set the `EnableWindowsTargeting` property to true. You can set it in the project file or by passing `/p:EnableWindowsTargeting=false` to a .NET CLI command, such as `dotnet build`. Here's an example project file: | ||
|
||
```xml | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<EnableWindowsTargeting>true</EnableWindowsTargeting> | ||
</PropertyGroup> | ||
</Project> | ||
``` | ||
|
||
If you want to apply this setting to your whole solution or repository, you can set it in a *Directory.Build.props* file. | ||
|
||
By default, .NET downloads all targeting packs (and runtime packs for self-contained builds) for the current target framework whether they're needed or not, because they might be brought in by a transitive framework reference. We didn't want to ship the Windows targeting packs with the non-Windows SDK builds, but we also didn't want a vanilla Console or ASP.NET Core app to automatically download these targeting and runtime packs the first time you build. The `EnableWindowsTargeting` property enables them to only be downloaded if you opt in. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
title: "NETSDK1112: The runtime pack was not downloaded" | ||
description: How to resolve the `runtime pack was not downloaded' error message. | ||
author: tdykstra | ||
ms.author: tdykstra | ||
ms.topic: error-reference | ||
ms.date: 07/08/2022 | ||
f1_keywords: | ||
- NETSDK1112 | ||
--- | ||
# NETSDK1112: The runtime pack was not downloaded | ||
|
||
A runtime pack that your project requires was not downloaded. The full error message is similar to the following example: | ||
|
||
> The runtime pack for `<Runtime>` was not downloaded. Try running a NuGet restore with the RuntimeIdentifier '`<RID>`'. | ||
|
||
This can happen in the following scenarios: | ||
|
||
* The publish parameters are different than what's in the project file. Review publish parameters and change any instances where publish parameters differ from the project file. | ||
* You used Debug configuration to build an app that is set up to require Release configuration. Try building with Release configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
title: "NETSDK1135: SupportedOSPlatformVersion can't be higher than TargetPlatformVersion" | ||
description: How to resolve the `SupportedOSPlatformVersion can't be higher than TargetPlatformVersion' error. | ||
author: tdykstra | ||
ms.author: tdykstra | ||
ms.topic: error-reference | ||
ms.date: 07/08/2022 | ||
f1_keywords: | ||
- NETSDK1135 | ||
--- | ||
# NETSDK1135: SupportedOSPlatformVersion can't be higher than TargetPlatformVersion | ||
|
||
The value that your project file specifies for `SupportedOSPlatformVersion` is too high. The full error message is similar to the following example: | ||
|
||
> SupportedOSPlatformVersion `<Version>` cannot be higher than `TargetPlatformVersion` `<Version>`. | ||
|
||
Check your project files for `SupportedOSPlatformVersion`. `TargetPlatformVersion` (TPV) is inferred from the `TargetFramework` value. For example, `net6.0-windows10.0.19041` will set the TPV to be `10.0.19041`. .NET uses `TargetPlatformVersion` to determine which APIs are available at compile time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
title: "NETSDK1136: The target platform must be set to Windows" | ||
description: Learn about the .NET SDK error that directs you to set your target platform to Windows. | ||
author: tdykstra | ||
ms.author: tdykstra | ||
ms.topic: error-reference | ||
ms.date: 07/08/2022 | ||
f1_keywords: | ||
- NETSDK1136 | ||
--- | ||
# NETSDK1136: The target framework must be Windows | ||
|
||
If `UseWindowsForms` or `UseWPF` is `true`, .NET assumes that your project is a Windows app, and so the platform has to be set to Windows. This error can happen if you have a project-to-project reference where one is set to Windows and the other is not. The full error message is similar to the following example: | ||
|
||
>The target platform must be set to Windows (usually by including `-windows` in the `TargetFramework` property) when using Windows Forms or WPF, or referencing projects or packages that do so. | ||
|
||
For example, set `TargetFramework` to `net6.0-windows`, as shown in this project file: | ||
|
||
```xml | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
<PropertyGroup> | ||
<TargetFramework>net6.0-windows</TargetFramework> | ||
</PropertyGroup> | ||
</Project> | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
title: "NETSDK1137: Don't use the Microsoft.NET.Sdk.WindowsDesktop SDK" | ||
description: How to resolve the `Don't use the Microsoft.NET.Sdk.WindowsDesktop SDK' error message. | ||
author: tdykstra | ||
ms.author: tdykstra | ||
ms.topic: error-reference | ||
ms.date: 07/08/2022 | ||
f1_keywords: | ||
- NETSDK1137 | ||
--- | ||
# NETSDK1137: Don't use the Microsoft.NET.Sdk.WindowsDesktop SDK | ||
|
||
NETSDK1137 indicates that your project specifies an outdated project SDK. The full error message is similar to the following example: | ||
|
||
> It is no longer necessary to use the Microsoft.NET.Sdk.WindowsDesktop SDK. Consider changing the Sdk attribute of the root Project element to 'Microsoft.NET.Sdk'. | ||
|
||
To resolve this error, modify your project file to have `<Project Sdk="Microsoft.NET.Sdk">` instead of the `WindowsDesktop` SDK. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
title: "NETSDK1138: The target framework is out of support" | ||
description: How to resolve the `framework out of support' error message. | ||
author: tdykstra | ||
ms.author: tdykstra | ||
ms.topic: error-reference | ||
ms.date: 07/08/2022 | ||
f1_keywords: | ||
- NETSDK1138 | ||
--- | ||
# NETSDK1138: The target framework is out of support | ||
|
||
NETSDK1138 indicates that your project targets a version of the framework that is out of support. The full error message is similar to the following example: | ||
|
||
> The target framework '\<framework>' is out of support and will not receive security updates in the future. Please refer to <https://aka.ms/dotnet-core-support> for more information about the support policy. | ||
|
||
Out-of-support versions include 1.0, 1.1, 2.0, 2.1, 2.2, and 3.0. In November 2022, .NET 5 will be added to this list. | ||
|
||
To resolve this error, change your project to target a supported version of .NET Core or .NET 5+. | ||
|
||
If you want to suppress the message without targeting a later framework, set the MSBuild property `CheckEolTargetFramework` to false. You can set it in the project file or by passing `/p:CheckEolTargetFramework=false` to a .NET CLI command, such as `dotnet build`. Here's an example project file: | ||
|
||
```xml | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp3.0</TargetFramework> | ||
<CheckEolTargetFramework>false</CheckEolTargetFramework> | ||
</PropertyGroup> | ||
</Project> | ||
``` | ||
|
||
Here's an example .NET CLI command: | ||
|
||
```dotnetcli | ||
dotnet build /p:CheckEolTargetFramework=false | ||
``` | ||
|
||
## See also | ||
|
||
* <https://aka.ms/dotnet-core-support> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
title: "NETSDK1182: Targeting .NET 6.0 or higher in Visual Studio 2019 is not supported." | ||
description: Learn about the 'Targeting .NET 6.0 or higher in Visual Studio 2019 is not supported' error message. | ||
author: tdykstra | ||
ms.author: tdykstra | ||
ms.topic: error-reference | ||
ms.date: 07/08/2022 | ||
f1_keywords: | ||
- NETSDK1182 | ||
--- | ||
# NETSDK1182: Targeting .NET 6.0 or higher in Visual Studio 2019 is not supported | ||
|
||
NETSDK1182 indicates that you're trying to open a .NET 6+ project in Visual Studio 2019. Or you might be trying to build from the command line using MSBuild from Visual Studio 2019. The full error message is similar to the following example: | ||
|
||
> Targeting .NET 6.0 or higher in Visual Studio 2019 is not supported. | ||
|
||
To resolve this error switch to Visual Studio 2022, or change your project to target .NET 5 or earlier. | ||
|
||
## See also | ||
|
||
* [Overview of .NET, MSBuild, and Visual Studio versioning](../../porting/versioning-sdk-msbuild-vs.md) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.