diff --git a/docs/core/compatibility/interop/5.0/built-in-support-for-winrt-removed.md b/docs/core/compatibility/interop/5.0/built-in-support-for-winrt-removed.md index 17aa042395f5c..b188e028ab13f 100644 --- a/docs/core/compatibility/interop/5.0/built-in-support-for-winrt-removed.md +++ b/docs/core/compatibility/interop/5.0/built-in-support-for-winrt-removed.md @@ -29,7 +29,7 @@ This breaking change was made for the following reasons: - Remove references to the [Microsoft.Windows.SDK.Contracts package](https://www.nuget.org/packages/Microsoft.Windows.SDK.Contracts). Instead, specify the version of the Windows APIs that you want to access via the `TargetFramework` property of the project. For example: ```xml - net5.0-windows10.0.19041 + net5.0-windows10.0.19041.0 ``` - Use the [C#/WinRT](/windows/uwp/csharp-winrt/) tool chain to generate or customize WinRT APIs and types for .NET 5 and later versions. diff --git a/docs/core/tools/sdk-errors/netsdk1130.md b/docs/core/tools/sdk-errors/netsdk1130.md new file mode 100644 index 0000000000000..a3be174ca91a6 --- /dev/null +++ b/docs/core/tools/sdk-errors/netsdk1130.md @@ -0,0 +1,27 @@ +--- +title: "NETSDK1130: Can't reference a Windows Metadata component directly" +description: How to resolve the issue of not being able to reference a Windows Metadata component directly from an app that targets .NET 5 or later. +author: tdykstra +ms.author: tdykstra +ms.topic: error-reference +ms.date: 06/29/2021 +f1_keywords: +- NETSDK1130 +--- +# NETSDK1130: Can't reference a Windows Metadata component directly + +NETSDK1130 indicates that you're trying to reference a Windows Metadata component directly from an app that targets .NET 5 or later. The full error message is similar to the following example: + +> *\* cannot be referenced. Referencing a Windows Metadata component directly when targeting .NET 5 or higher is not supported. + +To resolve this error: + +* Remove references to the [Microsoft.Windows.SDK.Contracts package](https://www.nuget.org/packages/Microsoft.Windows.SDK.Contracts). Instead, specify the version of the Windows APIs that you want to access via the `TargetFramework` property of the project. For example: + + ```xml + net5.0-windows10.0.19041.0 + ``` + +* Use the [C#/WinRT](/windows/uwp/csharp-winrt/) tool chain to generate or customize WinRT APIs and types for .NET 5 and later versions. + +For more information, see [Built-in support for WinRT is removed from .NET](../../compatibility/interop/5.0/built-in-support-for-winrt-removed.md) and [Call Windows Runtime APIs in desktop apps](/windows/apps/desktop/modernize/desktop-to-uwp-enhance). diff --git a/docs/core/tools/sdk-errors/netsdk1149.md b/docs/core/tools/sdk-errors/netsdk1149.md index 42fda5588dc83..65a59e650ff1a 100644 --- a/docs/core/tools/sdk-errors/netsdk1149.md +++ b/docs/core/tools/sdk-errors/netsdk1149.md @@ -1,5 +1,5 @@ --- -title: "NETSDK1149: Built-in WinRT support not provided in .NET 5+" +title: "NETSDK1149: Built-in WinRT support not provided in .NET 5 and later" description: How to reference a component with built-in WinRT support from an app that targets .NET 5 or later. author: tdykstra ms.author: tdykstra @@ -8,7 +8,7 @@ ms.date: 06/28/2021 f1_keywords: - NETSDK1149 --- -# NETSDK1149: Built-in WinRT support not provided in .NET 5+" +# NETSDK1149: Built-in WinRT support not provided in .NET 5 and later NETSDK1149 indicates that you're trying to reference a component that requires WinRT in an application that targets .NET 5 or a later version. These .NET versions don't have built-in support for WinRT. The full error message is similar to the following example: diff --git a/docs/fundamentals/toc.yml b/docs/fundamentals/toc.yml index bc301fb9b790b..d7a1c27e4ee10 100644 --- a/docs/fundamentals/toc.yml +++ b/docs/fundamentals/toc.yml @@ -204,6 +204,8 @@ items: href: ../core/tools/sdk-errors/netsdk1079.md - name: NETSDK1080 href: ../core/tools/sdk-errors/netsdk1080.md + - name: NETSDK1130 + href: ../core/tools/sdk-errors/netsdk1130.md - name: NETSDK1141 href: ../core/tools/sdk-errors/netsdk1141.md - name: NETSDK1145