Skip to content

Commit a4fb674

Browse files
authored
.NET 7 to .NET 8 (#1867)
* .NET 7 to .NET 8. * .NET 7 to 8 * net7 to net8
1 parent 7a1cc5d commit a4fb674

36 files changed

+127
-128
lines changed

docs/android/deployment/publish-cli.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ To build your app from the command line, and sign it using your keystore, open a
6464

6565
| Parameter | Value |
6666
|------------------------------|-------------------------------------------------------------------------------------------------|
67-
| `-f` or `--framework` | The target framework, which is `net7.0-android`. |
67+
| `-f` or `--framework` | The target framework, which is `net8.0-android`. |
6868
| `-c` or `--configuration` | The build configuration, which is `Release`. |
6969

7070
> [!WARNING]
@@ -96,19 +96,19 @@ For a full list of build properties, see [Build properties](/xamarin/android/dep
9696
Run the `dotnet publish` command with the following parameters to build and sign your app:
9797

9898
```console
99-
dotnet publish -f net7.0-android -c Release -p:AndroidKeyStore=true -p:AndroidSigningKeyStore={filename}.keystore -p:AndroidSigningKeyAlias={keyname} -p:AndroidSigningKeyPass={password} -p:AndroidSigningStorePass={password}
99+
dotnet publish -f net8.0-android -c Release -p:AndroidKeyStore=true -p:AndroidSigningKeyStore={filename}.keystore -p:AndroidSigningKeyAlias={keyname} -p:AndroidSigningKeyPass={password} -p:AndroidSigningStorePass={password}
100100
```
101101

102102
For example, use the following command to build and sign your app using the previously created keystore:
103103

104104
```console
105-
dotnet publish -f net7.0-android -c Release -p:AndroidKeyStore=true -p:AndroidSigningKeyStore=myapp.keystore -p:AndroidSigningKeyAlias=myapp -p:AndroidSigningKeyPass=mypassword -p:AndroidSigningStorePass=mypassword
105+
dotnet publish -f net8.0-android -c Release -p:AndroidKeyStore=true -p:AndroidSigningKeyStore=myapp.keystore -p:AndroidSigningKeyAlias=myapp -p:AndroidSigningKeyPass=mypassword -p:AndroidSigningStorePass=mypassword
106106
```
107107

108108
Both the `AndroidSigningKeyPass` and `AndroidSigningStorePass` properties support `env:` and `file:` prefixes that can be used to specify an environment variable or file that contains the password. Specifying the password in this way prevents it from appearing in build logs. For example, to use an environment variable named `AndroidSigningPassword`:
109109

110110
```console
111-
dotnet publish -f net7.0-android -c Release -p:AndroidKeyStore=true -p:AndroidSigningKeyStore=myapp.keystore -p:AndroidSigningKeyAlias=myapp -p:AndroidSigningKeyPass=env:AndroidSigningPassword -p:AndroidSigningStorePass=env:AndroidSigningPassword
111+
dotnet publish -f net8.0-android -c Release -p:AndroidKeyStore=true -p:AndroidSigningKeyStore=myapp.keystore -p:AndroidSigningKeyAlias=myapp -p:AndroidSigningKeyPass=env:AndroidSigningPassword -p:AndroidSigningStorePass=env:AndroidSigningPassword
112112
```
113113

114114
> [!IMPORTANT]
@@ -117,10 +117,10 @@ dotnet publish -f net7.0-android -c Release -p:AndroidKeyStore=true -p:AndroidSi
117117
To use a file located at *C:\Users\user1\AndroidSigningPassword.txt*:
118118

119119
```console
120-
dotnet publish -f net7.0-android -c Release -p:AndroidKeyStore=true -p:AndroidSigningKeyStore=myapp.keystore -p:AndroidSigningKeyAlias=myapp -p:AndroidSigningKeyPass=file:C:\Users\user1\AndroidSigningPassword.txt -p:AndroidSigningStorePass=file:C:\Users\user1\AndroidSigningPassword.txt
120+
dotnet publish -f net8.0-android -c Release -p:AndroidKeyStore=true -p:AndroidSigningKeyStore=myapp.keystore -p:AndroidSigningKeyAlias=myapp -p:AndroidSigningKeyPass=file:C:\Users\user1\AndroidSigningPassword.txt -p:AndroidSigningStorePass=file:C:\Users\user1\AndroidSigningPassword.txt
121121
```
122122

123-
Publishing builds and signs the app, and then copies the AAB and APK files to the *bin\\Release\\net7.0-android\\publish* folder. There are two AAB files - one unsigned and another signed. The signed variant has **-signed** in the file name.
123+
Publishing builds and signs the app, and then copies the AAB and APK files to the *bin\\Release\\net8.0-android\\publish* folder. There are two AAB files - one unsigned and another signed. The signed variant has **-signed** in the file name.
124124

125125
For more information about the `dotnet publish` command, see [dotnet publish](/dotnet/core/tools/dotnet-publish).
126126

docs/android/manifest.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.date: 03/07/2023
88

99
Every .NET Multi-platform App UI (.NET MAUI) app on Android has an *AndroidManifest.xml* file, located in the *Platforms\\Android* folder, that describes essential information about your app to build tools, the Android operating system, and Google Play.
1010

11-
The manifest file for your .NET MAUI Android app is generated as part of the .NET MAUI build process on Android. This build process takes the XML in the *Platforms\\Android\\AndroidManifest.xml* file, and merges it with any XML that's generated from specific attributes on your classes. The resulting manifest file can be found in the *obj* folder. For example, it can be found at *obj\\Debug\\net7.0-android\\AndroidManifest.xml* for debug builds on .NET 7.
11+
The manifest file for your .NET MAUI Android app is generated as part of the .NET MAUI build process on Android. This build process takes the XML in the *Platforms\\Android\\AndroidManifest.xml* file, and merges it with any XML that's generated from specific attributes on your classes. The resulting manifest file can be found in the *obj* folder. For example, it can be found at *obj\\Debug\\net8.0-android\\AndroidManifest.xml* for debug builds on .NET 8.
1212

1313
<!-- TODO: Uncomment when VS 17.6 P2 is released
1414
> [!NOTE]
@@ -181,7 +181,7 @@ public class MainApplication : MauiApplication
181181

182182
```
183183

184-
This declaration causes the following XML fragment to be generated in *obj\\Debug\\net7.0-android\\AndroidManifest.xml*:
184+
This declaration causes the following XML fragment to be generated in *obj\\Debug\\net8.0-android\\AndroidManifest.xml*:
185185

186186
```xml
187187
<application android:label="MyMauiApp" android:theme="@style/Maui.SplashTheme" android:debuggable="true" ...>

docs/deployment/visual-studio-properties.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The **Application** section describes some settings related to which platforms y
2828
| Setting | Default value | Description |
2929
| - | - | - |
3030
| Target the iOS platform | Checked | Specifies that this project will target the iOS platform. |
31-
| Target iOS Framework | `net7.0-ios` | The [Target Framework Moniker][tfm] used to target iOS.
31+
| Target iOS Framework | `net8.0-ios` | The [Target Framework Moniker][tfm] used to target iOS.
3232
| Minimum Target iOS Framework | `14.2` | The minimum version of iOS your app targets.
3333

3434
- **Android Targets**
@@ -38,7 +38,7 @@ The **Application** section describes some settings related to which platforms y
3838
| Setting | Default value | Description |
3939
| - | - | - |
4040
| Target the Android platform | Checked | When checked, the .NET MAUI project will target and build an Android version of your app. Uncheck to disable the Android target. |
41-
| Target Android Framework | `net7.0-android` | The [Target Framework Moniker][tfm] used to target Android.
41+
| Target Android Framework | `net8.0-android` | The [Target Framework Moniker][tfm] used to target Android.
4242
| Minimum Target Android Framework | `21.0` | The minimum version of Android your app targets.
4343

4444
- **Windows Targets**
@@ -48,7 +48,7 @@ The **Application** section describes some settings related to which platforms y
4848
| Setting | Default value | Description |
4949
| - | - | - |
5050
| Target the Windows platform | Checked | When checked, the .NET MAUI project will target and build a Windows version of your app. Uncheck to disable the Windows target. |
51-
| Target Windows Framework | `net7.0-windows10.0.19041.0` | The [Target Framework Moniker][tfm] used to target Windows.
51+
| Target Windows Framework | `net8.0-windows10.0.19041.0` | The [Target Framework Moniker][tfm] used to target Windows.
5252
| Minimum Target Windows Framework | `10.0.17763.0` | The minimum version of Windows your app targets.
5353

5454
## Build

docs/get-started/first-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ If your app fails to compile, review [Troubleshooting known issues](../troublesh
138138
:::zone pivot="devices-windows"
139139

140140
<!-- markdownlint-disable MD029 -->
141-
06. In the Visual Studio toolbar, use the **Debug Target** drop-down to select **Framework** and then the **net7.0-windows** entry:
141+
06. In the Visual Studio toolbar, use the **Debug Target** drop-down to select **Framework** and then the **net8.0-windows** entry:
142142

143143
:::image type="content" source="media/first-app/vs/windows-debug-target.png" alt-text="Select the Windows Machine debugging target for .NET MAUI.":::
144144

docs/get-started/installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ If you don't want to install Visual Studio, you can still get set up for .NET MA
126126
1. If you'd like to debug Android in Visual Studio Code, you also have to:
127127
1. Install [Microsoft OpenJDK 11](/java/openjdk/download#openjdk-11).
128128
1. Install the Android SDK. You can acquire the correct versions of the Android SDK and build tools by creating a new .NET MAUI project (`dotnet new maui`) and running the following command in your terminal:
129-
`dotnet build -t:InstallAndroidDependencies -f:net7.0-android -p:AndroidSdkDirectory="<ANDROID SDK DIRECTORY>" -p:AcceptAndroidSDKLicenses=True`
129+
`dotnet build -t:InstallAndroidDependencies -f:net8.0-android -p:AndroidSdkDirectory="<ANDROID SDK DIRECTORY>" -p:AcceptAndroidSDKLicenses=True`
130130
On Windows, the suggested Android SDK directory value is `%LOCALAPPDATA%/Android/Sdk`.
131131

132132
> [!NOTE]
@@ -141,7 +141,7 @@ If you don't want to install Visual Studio, you can still get set up for .NET MA
141141
1. If you'd like to debug to Android in Visual Studio Code, you also have to:
142142
1. Install [Microsoft OpenJDK 11](/java/openjdk/download#openjdk-11).
143143
1. Install the Android SDK. You can acquire the correct versions of the Android SDK and build tools by creating a new .NET MAUI project (`dotnet new maui`) and running the following command in your terminal:
144-
`dotnet build -t:InstallAndroidDependencies -f:net7.0-android -p:AndroidSdkDirectory="<ANDROID SDK DIRECTORY>" -p:AcceptAndroidSDKLicenses=True`
144+
`dotnet build -t:InstallAndroidDependencies -f:net8.0-android -p:AndroidSdkDirectory="<ANDROID SDK DIRECTORY>" -p:AcceptAndroidSDKLicenses=True`
145145
On macOS, the suggested Android SDK directory value is `$HOME/Library/Android/sdk`.
146146

147147
### Linux
@@ -210,7 +210,7 @@ This is a known issue if you install to `%APPDATA%` on Windows and will be fixed
210210
### Debugging issues
211211

212212
* Debugging can fail to start for multiple reasons. If there isn't a clear error in the Output window, first double check that you are using the ".NET MAUI" run configuration in Visual Studio Code.
213-
* You can try a command line build from the terminal to see if the error is with your code or the .NET MAUI extension. For example, you could run `dotnet build -f:net7.0-android` to see if your Android build succeeds outside of Visual Studio Code. If this build succeeds, please [Report an Issue](https://github.com/microsoft/vscode-dotnettools/issues)
213+
* You can try a command line build from the terminal to see if the error is with your code or the .NET MAUI extension. For example, you could run `dotnet build -f:net8.0-android` to see if your Android build succeeds outside of Visual Studio Code. If this build succeeds, please [Report an Issue](https://github.com/microsoft/vscode-dotnettools/issues)
214214

215215
## Known Limitations
216216

docs/ios/cli.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ In this tutorial, you'll learn how to create and run a .NET Multi-platform App U
1616

1717
```zsh
1818
cd MyMauiApp
19-
dotnet build -t:Run -f net7.0-ios
19+
dotnet build -t:Run -f net8.0-ios
2020
```
2121

2222
The `dotnet build` command will restore the project the dependencies, build the app, and launch it in the default simulator.
@@ -49,13 +49,13 @@ A .NET MAUI iOS app can be launched on a specific iOS simulator from a Mac by pr
4949
3. In **Terminal**, build the app and run it on your chosen simulator by specifying the `_DeviceName` MSBuild property using the `-p` [MSBuild option](/dotnet/core/tools/dotnet-build#msbuild):
5050

5151
```zsh
52-
dotnet build -t:Run -f net7.0-ios -p:_DeviceName=:v2:udid=MY_SPECIFIC_UDID
52+
dotnet build -t:Run -f net8.0-ios -p:_DeviceName=:v2:udid=MY_SPECIFIC_UDID
5353
```
5454

5555
For example, use the following command to build the app and run it on the iPhone 13 Pro simulator:
5656

5757
```zsh
58-
dotnet build -t:Run -f net7.0-ios -p:_DeviceName=:v2:udid=E25BBE37-69BA-4720-B6FD-D54C97791E79
58+
dotnet build -t:Run -f net8.0-ios -p:_DeviceName=:v2:udid=E25BBE37-69BA-4720-B6FD-D54C97791E79
5959
```
6060

6161
4. In your chosen simulator, press the **Click me** button several times and observe that the count of the number of button clicks is incremented.
@@ -81,7 +81,7 @@ A device must be provisioned before you can deploy an iOS app to it. For more in
8181
5. In **Terminal**, build the app and run it on your chosen simulator by specifying the `_DeviceName` MSBuild property using the `-p` [MSBuild option](/dotnet/core/tools/dotnet-build#msbuild):
8282

8383
```zsh
84-
dotnet build -t:Run -f net7.0-ios -p:RuntimeIdentifier=ios-arm64 -p:_DeviceName=MY_SPECIFIC_UDID
84+
dotnet build -t:Run -f net8.0-ios -p:RuntimeIdentifier=ios-arm64 -p:_DeviceName=MY_SPECIFIC_UDID
8585
```
8686

8787
Replace "MY_SPECIFIC_UDID" with the device identifier you copied to the clipboard.

docs/ios/deployment/publish-cli.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ To publish your app from the command line on a Mac, open a terminal and navigate
1616

1717
| Parameter | Value |
1818
|------------------------------|-------------------------------------------------------------------------------------------------|
19-
| `-f` or `--framework` | The target framework, which is `net7.0-ios`. |
19+
| `-f` or `--framework` | The target framework, which is `net8.0-ios`. |
2020
| `-c` or `--configuration` | The build configuration, which is `Release`. |
2121

2222
> [!WARNING]
@@ -44,10 +44,10 @@ For a full list of build properties, see [Project file properties](https://githu
4444
For example, use the following command to build and sign an *.ipa* on a Mac:
4545

4646
```dotnetcli
47-
dotnet publish -f net7.0-ios -c Release -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64 -p:CodesignKey="Apple Distribution: John Smith (AY2GDE9QM7)" -p:CodesignProvision="MyMauiApp"
47+
dotnet publish -f net8.0-ios -c Release -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64 -p:CodesignKey="Apple Distribution: John Smith (AY2GDE9QM7)" -p:CodesignProvision="MyMauiApp"
4848
```
4949

50-
Publishing builds and signs the app, and then copies the *.ipa* to the *bin/Release/net7.0-ios/ios-arm64/publish/* folder. The distribution channel for the app is specified in the distribution certificate contained within the provisioning profile. For information about creating provisioning profiles for the different distribution channels, see [Publish an iOS app for App Store distribution](publish-app-store.md), [Publish an iOS app for ad-hoc distribution](publish-ad-hoc.md), and [Publish an iOS app for in-house distribution](publish-in-house.md).
50+
Publishing builds and signs the app, and then copies the *.ipa* to the *bin/Release/net8.0-ios/ios-arm64/publish/* folder. The distribution channel for the app is specified in the distribution certificate contained within the provisioning profile. For information about creating provisioning profiles for the different distribution channels, see [Publish an iOS app for App Store distribution](publish-app-store.md), [Publish an iOS app for ad-hoc distribution](publish-ad-hoc.md), and [Publish an iOS app for in-house distribution](publish-in-house.md).
5151

5252
For more information about the `dotnet publish` command, see [dotnet publish](/dotnet/core/tools/dotnet-publish).
5353

@@ -60,29 +60,29 @@ If the `RuntimeIdentifier` parameter isn't specified on the command line, or in
6060
One solution to these issues is to add the following `<PropertyGroup>` to your project file:
6161

6262
```xml
63-
<PropertyGroup Condition="'$(IsPublishing)' == 'true' And '$(TargetFramework)' == 'net7.0-ios'">
63+
<PropertyGroup Condition="'$(IsPublishing)' == 'true' And '$(TargetFramework)' == 'net8.0-ios'">
6464
<RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
6565
</PropertyGroup>
6666
```
6767

6868
Then, use the following command to publish your app:
6969

7070
```dotnetcli
71-
dotnet publish -f net7.0-ios -p:IsPublishing=true ...
71+
dotnet publish -f net8.0-ios -p:IsPublishing=true ...
7272
```
7373

7474
An alternative solution to these issues is to add the following `<PropertyGroup>` to your project file:
7575

7676
```xml
77-
<PropertyGroup Condition="'$(Configuration)' == 'Release' And '$(TargetFramework)' == 'net7.0-ios'">
77+
<PropertyGroup Condition="'$(Configuration)' == 'Release' And '$(TargetFramework)' == 'net8.0-ios'">
7878
<RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
7979
</PropertyGroup>
8080
```
8181

8282
Then, use the following command to publish your app:
8383

8484
```dotnetcli
85-
dotnet publish -f net7.0-ios -c Release ...
85+
dotnet publish -f net8.0-ios -c Release ...
8686
```
8787

8888
## Define build properties in your project file
@@ -147,13 +147,13 @@ To publish your app from the command line on Windows, open a terminal and naviga
147147
For example, use the following command to build and sign an *.ipa* from Windows:
148148

149149
```dotnetcli
150-
dotnet publish -f net7.0-ios -c Release -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64 -p:CodesignKey="Apple Distribution: John Smith (AY2GDE9QM7)" -p:CodesignProvision="MyMauiApp" -p:ServerAddress={macOS build host IP address} -p:ServerUser={macOS username} -p:ServerPassword={macOS password} -p:TcpPort=58181 -p:_DotNetRootRemoteDirectory=/Users/{macOS username}/Library/Caches/Xamarin/XMA/SDKs/dotnet/
150+
dotnet publish -f net8.0-ios -c Release -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64 -p:CodesignKey="Apple Distribution: John Smith (AY2GDE9QM7)" -p:CodesignProvision="MyMauiApp" -p:ServerAddress={macOS build host IP address} -p:ServerUser={macOS username} -p:ServerPassword={macOS password} -p:TcpPort=58181 -p:_DotNetRootRemoteDirectory=/Users/{macOS username}/Library/Caches/Xamarin/XMA/SDKs/dotnet/
151151
```
152152

153153
> [!NOTE]
154154
> If the `ServerPassword` parameter is omitted from a command line build invocation, Pair to Mac attempts to log in to the Mac build host using its saved SSH keys.
155155
156-
Publishing builds and signs the app, and then copies the *.ipa* to the *bin\\Release\\net7.0-ios\\ios-arm64\\publish* folder on your Windows machine. The distribution channel for the app is specified in the distribution certificate contained within the provisioning profile. For information about creating distribution provisioning profiles for the different distribution channels, see [Publish an iOS app for App Store distribution](publish-app-store.md), [Publish an iOS app for ad-hoc distribution](publish-ad-hoc.md), and [Publish an iOS app for in-house distribution](publish-in-house.md)
156+
Publishing builds and signs the app, and then copies the *.ipa* to the *bin\\Release\\net8.0-ios\\ios-arm64\\publish* folder on your Windows machine. The distribution channel for the app is specified in the distribution certificate contained within the provisioning profile. For information about creating distribution provisioning profiles for the different distribution channels, see [Publish an iOS app for App Store distribution](publish-app-store.md), [Publish an iOS app for ad-hoc distribution](publish-ad-hoc.md), and [Publish an iOS app for in-house distribution](publish-in-house.md)
157157

158158
During the publishing process it maybe necessary to allow `codesign` to run on your paired Mac:
159159

docs/ios/pair-to-mac.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ If you encounter any trouble using automatic Mac provisioning, take a look at th
154154
Pair to Mac supports building .NET MAUI apps from the command line. Navigate to the folder that holds the source of your .NET MAUI iOS app and execute the following command:
155155

156156
```dotnet
157-
dotnet build -f net7.0-ios -p:ServerAddress={macOS build host IP address} -p:ServerUser={macOS username} -p:ServerPassword={macOS password} -p:TcpPort=58181 -p:_DotNetRootRemoteDirectory=/Users/{macOS username}/Library/Caches/Xamarin/XMA/SDKs/dotnet/
157+
dotnet build -f net8.0-ios -p:ServerAddress={macOS build host IP address} -p:ServerUser={macOS username} -p:ServerPassword={macOS password} -p:TcpPort=58181 -p:_DotNetRootRemoteDirectory=/Users/{macOS username}/Library/Caches/Xamarin/XMA/SDKs/dotnet/
158158
```
159159

160160
The parameters passed to `dotnet` in the above example are:

0 commit comments

Comments
 (0)