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: hub/apps/develop/launch/create-and-register-a-background-task.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,9 @@ dev_langs:
15
15
16
16
# Working with background tasks in Windows apps
17
17
18
+
> [!NOTE]
19
+
> This article covers background tasks built with the Windows Runtime (WinRT) [BackgroundTaskBuilder](/uwp/api/windows.applicationmodel.background.backgroundtaskbuilder) API in the **Windows.ApplicationModel.Background** namespace for apps with package identity, including UWP and packaged desktop apps. If you're building a new app or migrating an existing app to Windows App SDK, see [Using background tasks in Windows apps](/windows/apps/windows-app-sdk/applifecycle/background-tasks) and [Background task migration strategy](/windows/apps/windows-app-sdk/migrate-to-windows-app-sdk/guides/background-task-migration-strategy).
20
+
18
21
Learn how to create and register a background task in your app with the Windows Runtime (WinRT) [BackgroundTaskBuilder](/uwp/api/windows.applicationmodel.background.backgroundtaskbuilder) class.
Copy file name to clipboardExpand all lines: hub/apps/develop/platform/csharp-winrt/agile-objects.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
description: An agile object is one that can be accessed from any thread. C#/WinRT provides support for agile references if you need to marshal a non-agile object across apartments in a safe way.
3
3
title: Agile objects with C#/WinRT
4
-
ms.date: 11/17/2020
4
+
ms.date: 04/13/2026
5
5
ms.topic: article
6
6
ms.localizationpriority: medium
7
7
---
@@ -40,6 +40,6 @@ You can now pass `agileReference` to a thread in a different apartment, and use
Copy file name to clipboardExpand all lines: hub/apps/develop/platform/csharp-winrt/authoring.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Author Windows Runtime components with C#/WinRT
3
3
description: Overview of authoring Windows Runtime Components with C#/WinRT
4
-
ms.date: 03/15/2022
4
+
ms.date: 04/13/2026
5
5
ms.topic: article
6
6
ms.localizationpriority: medium
7
7
---
@@ -11,11 +11,11 @@ ms.localizationpriority: medium
11
11
> [!NOTE]
12
12
> Authoring Windows Runtime components with C#/WinRT is supported on .NET 6 and later.
13
13
14
-
The C#/WinRT NuGet package provides support for authoring your own Windows Runtime types and components in C#, and consuming them from any Windows Runtime-compatible language such as [C++/WinRT](/windows/uwp/cpp-and-winrt-apis/) or [Rust](../../../../dev-environment/rust/rust-for-windows.md). C#/WinRT authoring and hosting support requires .NET 6 and Visual Studio 2026, and it is intended to support desktop application scenarios including the [Windows App SDK](../../../windows-app-sdk/index.md), and [WinUI3](../../../winui/winui3/index.md).
14
+
The C#/WinRT NuGet package provides support for authoring your own Windows Runtime types and components in C#, and consuming them from any Windows Runtime-compatible language such as [C++/WinRT](/windows/uwp/cpp-and-winrt-apis/) or [Rust](../../../../dev-environment/rust/rust-for-windows.md). C#/WinRT authoring and hosting support requires .NET 6 or later and Visual Studio 2022 or later, and it is intended to support desktop application scenarios including the [Windows App SDK](../../../windows-app-sdk/index.md), and [WinUI3](../../../winui/winui3/index.md).
15
15
16
-
For a walkthrough showing how to author a Windows Runtime component with .NET 6, and how to consume it from a C++/WinRT console application, see [Walkthrough: Create a C#/WinRT component and consume it from C++/WinRT](./create-windows-runtime-component-cswinrt.md).
16
+
For a walkthrough showing how to author a Windows Runtime component with .NET 6 or later, and how to consume it from a C++/WinRT console application, see [Walkthrough: Create a C#/WinRT component and consume it from C++/WinRT](./create-windows-runtime-component-cswinrt.md).
17
17
18
-
For more details, and to search for or file any issues, refer to the [C#/WinRT Github repo](https://github.com/microsoft/CsWinRT) and [Authoring C#/WinRT Components](https://github.com/microsoft/CsWinRT/blob/master/docs/authoring.md).
18
+
For more details, and to search for or file any issues, refer to the [C#/WinRT GitHub repo](https://github.com/microsoft/CsWinRT) and [Authoring C#/WinRT Components](https://github.com/microsoft/CsWinRT/blob/master/docs/authoring.md).
Copy file name to clipboardExpand all lines: hub/apps/develop/platform/csharp-winrt/create-windows-runtime-component-cswinrt.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Walkthrough—Create a C#/WinRT component, and consume it from C++/WinRT
3
3
description: Author a Windows Runtime component with C#/WinRT, and consume it from a native application.
4
-
ms.date: 03/15/2022
4
+
ms.date: 04/13/2026
5
5
ms.topic: article
6
6
ms.localizationpriority: medium
7
7
---
@@ -18,8 +18,8 @@ For a walkthrough on authoring WinUI 3 controls with C#/WinRT specifically for u
18
18
19
19
This walkthrough requires the following tools and components:
20
20
21
-
-[Visual Studio 2022](/visualstudio/releases/2022/release-notes)
22
-
-[.NET 6.0 SDK](https://dotnet.microsoft.com/download/dotnet) or later
21
+
-[Visual Studio 2022 or later](/visualstudio/releases/2022/release-notes)
22
+
-[.NET 8.0 SDK (LTS)](https://dotnet.microsoft.com/download) or later
23
23
-[C++/WinRT VSIX](https://marketplace.visualstudio.com/items?itemName=CppWinRTTeam.cppwinrt101804264) for C++/WinRT project templates
24
24
25
25
## Create a simple Windows Runtime Component using C#/WinRT
@@ -41,7 +41,7 @@ Begin by creating a new project in Visual Studio. Select the **Class Library** p
41
41
42
42
a. In Solution Explorer, right click on the project node and select **Manage NuGet Packages**.
43
43
44
-
b. Search for the **Microsoft.Windows.CsWinRT** NuGet package and install the latest version. This walkthrough uses C#/WinRT version 1.4.1.
44
+
b. Search for the **Microsoft.Windows.CsWinRT** NuGet package and install the latest version.
45
45
46
46
3. Add a new `PropertyGroup` element that sets the `CsWinRTComponent` property. This specifies that your project is a Windows Runtime component so that a `.winmd` file is generated when you build the project.
47
47
@@ -95,7 +95,7 @@ When you build the package, the **Build** window should indicate that the NuGet
95
95
C#/WinRT authored Windows Runtime components can be consumed from any Windows Runtime (WinRT)-compatible language. The following steps demonstrate how to call the authored component above in a C++/WinRT console application.
96
96
97
97
> [!NOTE]
98
-
> Consuming a C#/WinRT component from C#/.NET apps is supported by both package reference or project reference. This scenario is equivalent to consuming any ordinary C# class library and does not involve WinRT activation in most cases. Starting with C#/WinRT 1.3.5, project references for C# consumers require .NET 6.
98
+
> Consuming a C#/WinRT component from C#/.NET apps is supported by both package reference or project reference. This scenario is equivalent to consuming any ordinary C# class library and does not involve WinRT activation in most cases. Starting with C#/WinRT 1.3.5, project references for C# consumers require .NET 6 or later.
99
99
100
100
1. Add a new **C++/WinRT Console Application** project to your solution. Note that this project can also be part of a different solution if you choose so.
-[Visual Studio 2022 or later](/visualstudio/releases/2022/release-notes)
22
+
-[.NET 8.0 SDK (LTS)](https://dotnet.microsoft.com/download) or later
23
23
-[Windows App SDK VSIX](../../../windows-app-sdk/downloads.md) (1.1 from the stable channel)
24
24
25
25
## Author your C#/WinRT component using the Windows App SDK
@@ -104,7 +104,7 @@ This walkthrough requires the following tools and components:
104
104
1. You can now build the **WinUIComponentCs** project to generate a `.winmd` file for the component.
105
105
106
106
> [!NOTE]
107
-
> You can also package the component as a NuGet package for end app consumers to reference. For more details, see [Authoring C#/WinRT components](https://github.com/microsoft/CsWinRT/blob/master/docs/authoring.md) on the C#/WinRT Github repo.
107
+
> You can also package the component as a NuGet package for end app consumers to reference. For more details, see [Authoring C#/WinRT components](https://github.com/microsoft/CsWinRT/blob/master/docs/authoring.md) on the C#/WinRT GitHub repo.
108
108
109
109
## Reference the component from a Windows App SDK C++/WinRT app
110
110
@@ -177,8 +177,8 @@ Consumption from packaged apps that use a separate **Windows Application Packagi
177
177
178
178
## Known issues
179
179
180
-
- Consuming a C# component as a project reference requires `PublishReadyToRun` to be set to `False`. See [Github Issue #1151](https://github.com/microsoft/CsWinRT/issues/1151) for more details.
181
-
- Consuming a C# component built for `AnyCPU` from C++ is supported only from `x86` applications currently. `x64` and `Arm64` apps result in a runtime error similar to: *%1 is not a valid Win32 application.* See [Github Issue #1151](https://github.com/microsoft/CsWinRT/issues/1093) for more details.
180
+
- Consuming a C# component as a project reference requires `PublishReadyToRun` to be set to `False`. See [GitHub Issue #1151](https://github.com/microsoft/CsWinRT/issues/1151) for more details.
181
+
- Consuming a C# component built for `AnyCPU` from C++ is supported only from `x86` applications currently. `x64` and `Arm64` apps result in a runtime error similar to: *%1 is not a valid Win32 application.* See [GitHub Issue #1093](https://github.com/microsoft/CsWinRT/issues/1093) for more details.
Copy file name to clipboardExpand all lines: hub/apps/develop/platform/csharp-winrt/index.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
description: C#/WinRT is a tool set that provides WinRT projection support for C# code.
3
3
title: C#/WinRT
4
-
ms.date: 05/19/2020
4
+
ms.date: 04/13/2026
5
5
ms.topic: article
6
6
keywords: windows 10, uwp, standard, c#, winrt, cswinrt, projection
7
7
ms.localizationpriority: medium
@@ -13,7 +13,7 @@ C#/WinRT is a NuGet-packaged toolkit that provides Windows Runtime (WinRT) proje
13
13
14
14
C#/WinRT currently provides support for consuming WinRT APIs through the use of [Target Framework Monikers](../../../desktop/modernize/desktop-to-uwp-enhance.md) (TFMs) in .NET. Setting the TFM with a specific Windows SDK version adds references to the Windows SDK projection and runtime assemblies generated by C#/WinRT.
15
15
16
-
The [C#/WinRT NuGet package](https://www.nuget.org/packages/Microsoft.Windows.CsWinRT/) enables you to [create](#generate-and-distribute-an-interop-assembly) and [reference](#reference-an-interop-assembly) your own WinRT interop assemblies for .NET consumers. The latest C#/WinRT version also includes a [preview of authoring](create-windows-runtime-component-cswinrt.md) WinRT types in C#.
16
+
The [C#/WinRT NuGet package](https://www.nuget.org/packages/Microsoft.Windows.CsWinRT/) enables you to [create](#generate-and-distribute-an-interop-assembly) and [reference](#reference-an-interop-assembly) your own WinRT interop assemblies for .NET consumers. The latest C#/WinRT version also supports [authoring](create-windows-runtime-component-cswinrt.md) WinRT types in C#.
17
17
18
18
For additional information, see the [C#/WinRT GitHub repo](https://aka.ms/cswinrt/repo).
19
19
@@ -29,7 +29,7 @@ Finally, C#/WinRT is a general toolkit and is intended to support other scenario
29
29
30
30
## What's new
31
31
32
-
The latest C#/WinRT releases can be found on our [release notes](https://github.com/microsoft/CsWinRT/releases) page in the Github repo.
32
+
The latest C#/WinRT releases can be found on our [release notes](https://github.com/microsoft/CsWinRT/releases) page in the GitHub repo.
33
33
34
34
## Usage
35
35
@@ -47,7 +47,7 @@ Typically, C#/WinRT interop assemblies are referenced by application projects. B
47
47
48
48
If you distribute a third-party WinRT component without an official interop assembly, an application project may follow the procedure for [generating an interop assembly](#generate-and-distribute-an-interop-assembly) to generate its own private projection sources. We don't recommend this approach, because it can produce conflicting projections of the same type within a process. NuGet packaging, following the [Semantic Versioning](https://semver.org) scheme, is designed to prevent this. An official third-party interop assembly is preferred.
49
49
50
-
### Embedded support for WinRT types (Preview)
50
+
### Embedded support for WinRT types
51
51
52
52
Starting with C#/WinRT version 1.4.1, support is included for embedding Windows SDK projection and runtime sources for both .NET and .NET Standard 2.0 into your library or app's output. This is useful in cases where usage of Windows SDK types is self-contained. Embedded support removes dependencies on WinRT.Runtime.dll and Microsoft.Windows.SDK.NET.dll which reduces the library or app output size. It also allows library developers to provide downlevel support and removes the need for multi-targeting.
Copy file name to clipboardExpand all lines: hub/apps/develop/platform/csharp-winrt/net-mappings-of-winrt-types.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: .NET mappings of WinRT types in C#/WinRT
3
3
description: The following table lists the mappings that C#/WinRT makes between Windows Runtime types and .NET types.
4
-
ms.date: 04/19/2020
4
+
ms.date: 04/13/2026
5
5
ms.topic: article
6
6
keywords: windows 10, uwp
7
7
ms.localizationpriority: medium
@@ -18,7 +18,7 @@ The C#/WinRT custom type mappings are categorized by types in the Windows SDK or
18
18
-**WinRT types that map to .NET types with the same name and namespace.** These custom mappings are generally for performance or enhancement reasons, and are implemented directly in C#. Most of the types that have the same namespace name and type name in WinRT and .NET are structures (or types associated with structures, such as enumerations). In WinRT, structures have no members other than fields, and require helper types, which .NET hides. The .NET versions of these structures have properties and methods that provide the functionality of the hidden helper types (for example, **Windows.UI.Color**).
19
19
20
20
> [!NOTE]
21
-
> For a list of mappings between WinRT and .NET types in the context of UWP apps, see [.NET mappings of WinRT types in UWP](/windows/apps/develop/platform/csharp-winrt/net-mappings-of-winrt-types).
21
+
> For a list of mappings between WinRT and .NET types in the context of UWP apps, see [.NET mappings of Windows Runtime types](/windows/uwp/winrt-components/net-framework-mappings-of-windows-runtime-types).
22
22
23
23
## Mappings for WinRT types in the Windows SDK
24
24
@@ -99,4 +99,4 @@ The C#/WinRT custom type mappings are categorized by types in the Windows SDK or
0 commit comments