Skip to content

Commit a3db3dd

Browse files
Kbridge/main/fix target framework references (#5185)
* fix-target-framework-references * RuntimeIdentifiers
1 parent a92010a commit a3db3dd

15 files changed

+28
-28
lines changed

hub/apps/design/shell/tiles-and-notifications/secondary-tiles-desktop-pinning.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ If you're using WPF or WinForms, and you haven't packaged your app with the Desk
3737

3838
```xml
3939
<PropertyGroup>
40-
<!-- You can also target other versions of the Windows SDK and .NET; for example, "net6.0-windows10.0.19041.0" -->
41-
<TargetFramework>net6.0-windows10.0.22000.0</TargetFramework>
40+
<!-- You can also target other versions of the Windows SDK and .NET; for example, "net8.0-windows10.0.19041.0" -->
41+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
4242
</PropertyGroup>
4343
```
4444

hub/apps/desktop/modernize/desktop-to-uwp-enhance.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,24 @@ This option is supported only in projects that use .NET 6 (or later) and target
3535
<Project Sdk="Microsoft.NET.Sdk">
3636
<PropertyGroup>
3737
<OutputType>WinExe</OutputType>
38-
<TargetFramework>net5.0</TargetFramework>
38+
<TargetFramework>net8.0</TargetFramework>
3939
</PropertyGroup>
4040
</Project>
4141
```
4242

4343
2. Leaving all other settings as they are, replace the value of the **TargetFramework** element with one of the following strings:
4444

45-
* **net6.0-windows10.0.17763.0**: If your app targets Windows 10, version 1809.
46-
* **net6.0-windows10.0.18362.0**: If your app targets Windows 10, version 1903.
47-
* **net6.0-windows10.0.19041.0**: If your app targets Windows 10, version 2004.
48-
* **net6.0-windows10.0.22000.0**: If your app targets initial release of Windows 11.
49-
* **net6.0-windows10.0.22621.0**: If your app targets Windows 11, version 22H2.
50-
* **net6.0-windows10.0.26100.0**: If your app targets Windows 11, version 24H2.
45+
* **net8.0-windows10.0.17763.0**: If your app targets Windows 10, version 1809.
46+
* **net8.0-windows10.0.18362.0**: If your app targets Windows 10, version 1903.
47+
* **net8.0-windows10.0.19041.0**: If your app targets Windows 10, version 2004.
48+
* **net8.0-windows10.0.22000.0**: If your app targets initial release of Windows 11.
49+
* **net8.0-windows10.0.22621.0**: If your app targets Windows 11, version 22H2.
50+
* **net8.0-windows10.0.26100.0**: If your app targets Windows 11, version 24H2.
5151

5252
For example, the following element is for a project that targets Windows 10, version 2004.
5353

5454
```xml
55-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
55+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
5656
```
5757

5858
In later versions of .NET, you can replace the value with the relevant version, for example **net8.0-windows10.0.19041.0**.
@@ -78,7 +78,7 @@ The **TargetPlatformMinVersion** can be overridden to be less than the **TargetP
7878
<Project Sdk="Microsoft.NET.Sdk">
7979
<PropertyGroup>
8080
<OutputType>WinExe</OutputType>
81-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
81+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
8282
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
8383
</PropertyGroup>
8484
</Project>

hub/apps/desktop/modernize/winrt-com-interop-csharp.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ For other .NET desktop project types&mdash;such as [Windows Presentation Foundat
3030

3131
```xml
3232
<PropertyGroup>
33-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
33+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
3434
</PropertyGroup>
3535
```
3636

hub/apps/develop/platform/csharp-winrt/create-windows-runtime-component-cswinrt.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Begin by creating a new project in Visual Studio. Select the **Class Library** p
3030

3131
```xml
3232
<PropertyGroup>
33-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
33+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
3434
<Platforms>x64</Platforms>
3535
</PropertyGroup>
3636
```

hub/apps/develop/platform/csharp-winrt/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ C#/WinRT uses the [LoadLibrary alternate search order](/windows/win32/dlls/dynam
8181

8282
To address this error, edit your `<TargetFramework>` property to target a specific Windows version, for example:
8383
```xml
84-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
84+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
8585
```
8686
Refer to the docs on [Calling Windows Runtime APIs](../../../desktop/modernize/desktop-to-uwp-enhance.md) for more details on specifying the `<TargetFramework>` property.
8787

hub/apps/develop/platform/csharp-winrt/net-projection-from-cppwinrt-component.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Before you can invoke the `cswinrt.exe` tool to generate the projection assembly
126126

127127
```xml
128128
<PropertyGroup>
129-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
129+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
130130
<!-- Set Platform to AnyCPU to allow consumption of the projection assembly from any architecture. -->
131131
<Platform>AnyCPU</Platform>
132132
</PropertyGroup>

hub/apps/package-and-deploy/project-properties.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Here's an excerpt from a typical `.csproj` file for a C# WinUI 3 project showing
2929
<Project Sdk="Microsoft.NET.Sdk">
3030
<PropertyGroup>
3131
<OutputType>WinExe</OutputType>
32-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
32+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
3333
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
3434
...
3535
<UseWinUI>true</UseWinUI>

hub/apps/windows-app-sdk/migrate-to-windows-app-sdk/upgrade-assistant.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ The version numbers in your resulting `.csproj` will be slightly different, but
111111
```xml
112112
<Project Sdk="Microsoft.NET.Sdk">
113113
<PropertyGroup>
114-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
114+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
115115
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
116116
<OutputType>WinExe</OutputType>
117117
<DefaultLanguage>en-US</DefaultLanguage>
118118
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
119-
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
119+
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
120120
<UseWinUI>true</UseWinUI>
121121
<ApplicationManifest>app.manifest</ApplicationManifest>
122122
<EnableMsixTooling>true</EnableMsixTooling>

hub/apps/windows-app-sdk/migrate-to-windows-app-sdk/winforms-plus-winappsdk.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ First we'll edit the project file.
4444
2. This step enables you to call [Windows Runtime (WinRT) APIs](/uwp/api/) (including [Windows App SDK APIs](/windows/windows-app-sdk/api/winrt/)). Inside the **PropertyGroup** element is the **TargetFramework** element, which is set to a value such as *net6.0*. Append to that target framework value a moniker (specifically, a [Target Framework Moniker](/windows/apps/desktop/modernize/desktop-to-uwp-enhance#net-6-and-later-use-the-target-framework-moniker-option)). For example, use the following if your app targets Windows 10, version 2004:
4545

4646
```xml
47-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
47+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
4848
```
4949

5050
3. Also inside the **PropertyGroup** element, add a [RuntimeIdentifiers](/dotnet/core/project-sdk/msbuild-props#runtimeidentifiers) element, like this:
5151

5252
```xml
53-
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
53+
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
5454
```
5555

5656
4. By default, a WinForms app is unpackaged (meaning that it isn't installed by using MSIX). An unpackaged app must initialize the Windows App SDK runtime before using any other feature of the Windows App SDK. You can do that automatically when your app starts via *auto-initialization*. You just set (also inside the **PropertyGroup** element) the `WindowsPackageType` project property appropriately, like this:

hub/apps/windows-app-sdk/migrate-to-windows-app-sdk/wpf-plus-winappsdk.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ First we'll edit the project file.
4444
2. This step enables you to call [Windows Runtime (WinRT) APIs](/uwp/api/) (including [Windows App SDK APIs](/windows/windows-app-sdk/api/winrt/)). Inside the **PropertyGroup** element is the **TargetFramework** element, which is set to a value such as *net6.0*. Append to that target framework value a moniker (specifically, a [Target Framework Moniker](/windows/apps/desktop/modernize/desktop-to-uwp-enhance#net-6-and-later-use-the-target-framework-moniker-option)). For example, use the following if your app targets Windows 10, version 2004:
4545

4646
```xml
47-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
47+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
4848
```
4949

5050
3. Also inside the **PropertyGroup** element, add a [RuntimeIdentifiers](/dotnet/core/project-sdk/msbuild-props#runtimeidentifiers) element, as shown below. If you're targeting .NET 8 or later, then use the value `win-x86;win-x64;win-arm64` instead.
5151

5252
```xml
53-
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
53+
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
5454
```
5555

5656
4. By default, a WPF app is unpackaged (meaning that it isn't installed by using MSIX). An unpackaged app must initialize the Windows App SDK runtime before using any other feature of the Windows App SDK. You can do that automatically when your app starts via *auto-initialization*. You just set (also inside the **PropertyGroup** element) the `WindowsPackageType` project property appropriately, like this:

hub/apps/windows-app-sdk/preview-experimental-unpackaged-tutorial.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Follow these instructions to configure a C# project. Starting in [1.0 Preview 3]
133133
2. Replace the value of the **TargetFramework** element with a [Target Framework Moniker](../desktop/modernize/desktop-to-uwp-enhance.md#net-6-and-later-use-the-target-framework-moniker-option). For example, use the following if your app targets Windows 10, version 2004.
134134

135135
```xml
136-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
136+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
137137
```
138138

139139
3. Save and close the project file.
@@ -217,7 +217,7 @@ Follow these instructions to configure a C# project that uses the [1.0 Experimen
217217
2. Replace the value of the **TargetFramework** element with a [Target Framework Moniker](../desktop/modernize/desktop-to-uwp-enhance.md#net-6-and-later-use-the-target-framework-moniker-option). For example, use the following if your app targets Windows 10, version 2004.
218218

219219
```xml
220-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
220+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
221221
```
222222

223223
3. Save and close the project file.

hub/apps/windows-app-sdk/release-notes-archive/stable-channel-0.8.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ This is a servicing release of the Windows App SDK that includes several perform
9090
<Project Sdk="Microsoft.NET.Sdk">
9191
<PropertyGroup>
9292
<OutputType>WinExe</OutputType>
93-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
93+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
9494
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
9595
<WindowsSdkPackageVersion>10.0.19041.24</WindowsSdkPackageVersion>
9696
<PropertyGroup>

hub/apps/windows-app-sdk/release-notes-archive/stable-channel-1.0.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ For more information, see [Manage resources with MRT Core](../mrtcore/mrtcore-ov
288288
- **Upgrading from .NET 5 to .NET 6**: When upgrading in the Visual Studio UI, you might run into build errors. As a workaround, manually update your project file's `TargetFrameworkPackage` to the below:
289289

290290
```xml
291-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
291+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
292292
```
293293

294294
- **C# Single-project MSIX app doesn't compile if C++ UWP Tools aren't installed.** If you have a C# Single-project MSIX project, then you'll need to install the **C++ (v14x) Universal Windows Platform Tools** optional component.

hub/apps/windows-app-sdk/single-project-msix.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Next, edit some configuration settings to use the single-project MSIX feature. T
8383
<Project Sdk="Microsoft.NET.Sdk">
8484
<PropertyGroup>
8585
<OutputType>WinExe</OutputType>
86-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
86+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
8787
...
8888
<UseWinUI>true</UseWinUI>
8989
<EnableMsixTooling>true</EnableMsixTooling>

hub/apps/windows-app-sdk/tutorial-unpackaged-deployment.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Follow these instructions to configure a C# WinUI 3 project that's either packag
4444
1. Replace the value of the **TargetFramework** element with a [Target Framework Moniker](../desktop/modernize/desktop-to-uwp-enhance.md#net-6-and-later-use-the-target-framework-moniker-option). For example, use the following if your app targets Windows 10, version 2004.
4545

4646
```xml
47-
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
47+
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
4848
```
4949

5050
1. Save and close the project file.

0 commit comments

Comments
 (0)