-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge preview 6 release branch to master (#19209)
* Add ArgumentNullExceptions for Preview 6 (#18993) * Removal of PlatformAbstractions package (#19010) * Add WinRT removal breaking change (#19086) * fixes #18875
- Loading branch information
Showing
8 changed files
with
169 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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 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,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)] | ||
|
||
*** |
This file contains 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 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
62 changes: 62 additions & 0 deletions
62
includes/core-changes/corefx/5.0/platformabstractions-package-removed.md
This file contains 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,62 @@ | ||
### Microsoft.DotNet.PlatformAbstractions package removed | ||
|
||
No new versions of the [Microsoft.DotNet.PlatformAbstractions NuGet package](https://www.nuget.org/packages/Microsoft.DotNet.PlatformAbstractions/) will be produced. | ||
|
||
#### Change description | ||
|
||
Previously, new versions of the <xref:Microsoft.DotNet.PlatformAbstractions?displayProperty=fullName> library were produced alongside new versions of .NET Core. Going forward, no new functionality will be added to the library, and no new major versions will be released. However, existing versions of the library will continue to work and be serviced. | ||
|
||
The <xref:Microsoft.DotNet.PlatformAbstractions?displayProperty=fullName> library overlaps with APIs that are already established in the System.\* namespaces. Also, some <xref:Microsoft.DotNet.PlatformAbstractions> APIs weren't designed with the same level of scrutiny and long-term supportability as the rest of the System.\* APIs. For example, <xref:Microsoft.DotNet.PlatformAbstractions> uses the `Platform` enumeration to describe the current operating system platform. This enumeration design was explicitly rejected when the <xref:System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform)?displayProperty=nameWithType> API was designed, to allow for new platforms and future flexibility. | ||
|
||
The scenarios enabled by the <xref:Microsoft.DotNet.PlatformAbstractions?displayProperty=fullName> library are now possible without it. Existing versions will continue to work, even in .NET 5.0 and later, and will be serviced along with previous versions of .NET Core. However, new functionality won't be added to the library. Instead, new functionality will be added to other libraries and APIs. | ||
|
||
#### Version introduced | ||
|
||
5.0 Preview 6 | ||
|
||
#### Recommended action | ||
|
||
- You can continue to use older versions of the library if they meet your requirements. | ||
|
||
- If the older versions don't meet your requirements, replace usages of the `PlatformAbstractions` APIs with the recommended replacements. | ||
|
||
| `PlatformAbstractions` API | Recommended replacement | | ||
|-|-| | ||
| `ApplicationEnvironment.ApplicationBasePath` | <xref:System.AppContext.BaseDirectory?displayProperty=nameWithType> | | ||
| <xref:Microsoft.DotNet.PlatformAbstractions.HashCodeCombiner> | <xref:System.HashCode?displayProperty=nameWithType> | | ||
| `RuntimeEnvironment.GetRuntimeIdentifier()` | <xref:System.Runtime.InteropServices.RuntimeInformation.RuntimeIdentifier?displayProperty=nameWithType> | | ||
| `RuntimeEnvironment.OperatingSystemPlatform` | <xref:System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform)?displayProperty=nameWithType> | | ||
| `RuntimeEnvironment.RuntimeArchitecture` | <xref:System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture?displayProperty=nameWithType> | | ||
| `RuntimeEnvironment.OperatingSystem` | <xref:System.Runtime.InteropServices.RuntimeInformation.OSDescription?displayProperty=nameWithType> | | ||
| `RuntimeEnvironment.OperatingSystemVersion` | <xref:System.Runtime.InteropServices.RuntimeInformation.OSDescription?displayProperty=nameWithType> and <xref:System.Environment.OSVersion?displayProperty=nameWithType> | | ||
|
||
> [!NOTE] | ||
> Most use cases for `RuntimeEnvironment.OperatingSystem` and `RuntimeEnvironment.OperatingSystemVersion` are for display purposes, for example, displaying to a user, logging, and telemetry. It's not recommended to make run-time decisions based on an operating system (OS) version. <xref:System.Environment.OSVersion?displayProperty=nameWithType> now returns the correct version for Windows and macOS operating systems. However, for most Unix distributions, what is considered to be the "OS version" is not as straightforward. For example, it could be the Linux kernel version, or it could be the distro version. For most Unix platforms, <xref:System.Environment.OSVersion?displayProperty=nameWithType> and <xref:System.Runtime.InteropServices.RuntimeInformation.OSDescription?displayProperty=nameWithType> return the version that's returned by `uname`. To get the Linux distro name and version information, the recommended approach is to read the */etc/os-release* file. | ||
#### Category | ||
|
||
Core .NET libraries | ||
|
||
#### Affected APIs | ||
|
||
- `Microsoft.DotNet.PlatformAbstractions.ApplicationEnvironment.ApplicationBasePath` | ||
- <xref:Microsoft.DotNet.PlatformAbstractions.HashCodeCombiner?displayProperty=fullName> | ||
- `Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.GetRuntimeIdentifier()` | ||
- `Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.OperatingSystem` | ||
- `Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.OperatingSystemPlatform` | ||
- `Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.OperatingSystemVersion` | ||
- `Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.RuntimeArchitecture` | ||
|
||
<!-- | ||
#### Affected APIs | ||
- `P:Microsoft.DotNet.PlatformAbstractions.ApplicationEnvironment.ApplicationBasePath` | ||
- `T:Microsoft.DotNet.PlatformAbstractions.HashCodeCombiner` | ||
- `M:Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.GetRuntimeIdentifier` | ||
- `P:Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.OperatingSystem` | ||
- `P:Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.OperatingSystemPlatform` | ||
- `P:Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.OperatingSystemVersion` | ||
- `P:Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.RuntimeArchitecture` | ||
--> |
54 changes: 54 additions & 0 deletions
54
includes/core-changes/interop/5.0/built-in-support-for-winrt-removed.md
This file contains 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,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` | ||
--> |
This file contains 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