Skip to content
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

Add WinRT removal breaking change #19086

Merged
merged 2 commits into from
Jun 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/core/compatibility/3.1-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ If you're migrating from version 3.1 of .NET Core, ASP.NET Core, or EF Core to v

***

## Interop

- [Built-in support for WinRT is removed from .NET](#built-in-support-for-winrt-is-removed-from-net)

[!INCLUDE [built-in-support-for-winrt-removed](~/includes/core-changes/interop/5.0/built-in-support-for-winrt-removed.md)]

***

## Windows Forms

- [Removed status bar controls](#removed-status-bar-controls)
Expand Down
18 changes: 18 additions & 0 deletions docs/core/compatibility/interop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Interop breaking changes
description: Lists the breaking changes in interop in .NET Core and .NET 5.0 and later.
ms.date: 06/23/2020
---
# Interop breaking changes

The following breaking changes are documented on this page:

| Breaking change | Version introduced |
| - | :-: |
| [Built-in support for WinRT is removed from .NET](#built-in-support-for-winrt-is-removed-from-net) | 5.0 |

## .NET 5.0

[!INCLUDE [built-in-support-for-winrt-removed](~/includes/core-changes/interop/5.0/built-in-support-for-winrt-removed.md)]

***
2 changes: 2 additions & 0 deletions docs/core/compatibility/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
href: /ef/core/what-is-new/ef-core-3.0/breaking-changes?toc=/dotnet/core/compatibility/toc.json&bc=/dotnet/breadcrumb/toc.json
- name: Globalization
href: globalization.md
- name: Interop
href: interop.md
- name: MSBuild
href: msbuild.md
- name: Networking
Expand Down
1 change: 1 addition & 0 deletions includes/core-changes/categoryselector.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
> - [Cryptography](~/docs/core/compatibility/cryptography.md)
> - [EF Core](/ef/core/what-is-new/ef-core-3.0/breaking-changes)
> - [Globalization](~/docs/core/compatibility/globalization.md)
> - [Interop](~/docs/core/compatibility/interop.md)
> - [Networking](~/docs/core/compatibility/networking.md)
> - [Visual Basic](~/docs/core/compatibility/visualbasic.md)
> - [Windows Forms](~/docs/core/compatibility/winforms.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
### Built-in support for WinRT is removed from .NET

Built-in support for consumption of [Windows runtime (WinRT)](/uwp/winrt-cref/winrt-type-system) APIs in .NET is removed.

#### Version introduced

5.0 Preview 6

#### Change description

Previously, CoreCLR could consume [Windows metadata (WinMD) files](/uwp/winrt-cref/winmd-files) to active and consume WinRT types. Starting in .NET 5.0, CoreCLR can no longer consume WinMD files directly.

If you attempt to reference an unsupported assembly, you'll get a <xref:System.IO.FileNotFoundException>. If you activate a WinRT class, you'll get a <xref:System.PlatformNotSupportedException>.

This breaking change was made for the following reasons:

- So WinRT can be developed and improved separately from the .NET runtime.
- For symmetry with interop systems provided for other operating systems, such as iOS and Android.
- To take advantage of other .NET features, such as C# features, intermediate language (IL) linking, and ahead-of-time (AOT) compilation.
- To simplify the .NET runtime codebase.

#### Recommended action

- Remove references to the [Microsoft.Windows.SDK.Contracts package](https://www.nuget.org/packages/Microsoft.Windows.SDK.Contracts) and replace them with references to the [Microsoft.Windows.SDK.NET package](https://www.nuget.org/packages/microsoft.windows.sdk.net).

- Use the [C#/WinRT](/windows/uwp/csharp-winrt/) tool chain to generate or customize WinRT APIs and types in .NET 5.0 and later versions.

#### Category

Interop

#### Affected APIs

- <xref:System.IO.WindowsRuntimeStorageExtensions?displayProperty=fullName>
- <xref:System.IO.WindowsRuntimeStreamExtensions?displayProperty=fullName>
- <xref:System.Runtime.InteropServices.WindowsRuntime?displayProperty=fullName>
- <xref:System.WindowsRuntimeSystemExtensions?displayProperty=fullName>
- <xref:Windows.Foundation.Point?displayProperty=fullName>
- <xref:Windows.Foundation.Size?displayProperty=fullName>
- <xref:Windows.UI.Color?displayProperty=fullName>

<!--

#### Affected APIs

- `T:System.IO.WindowsRuntimeStorageExtensions`
- `T: System.IO.WindowsRuntimeStreamExtensions`
- `N:System.Runtime.InteropServices.WindowsRuntime`
- `T:System.WindowsRuntimeSystemExtensions`
- `T:Windows.Foundation.Point`
- `T:Windows.Foundation.Size`
- `T:Windows.UI.Color`

-->