Skip to content

Commit

Permalink
Build your first app in .NET 8 (#1868)
Browse files Browse the repository at this point in the history
* .NET 8 images.

* Try .NET 7/8 split.

* iOS images.

* Fix image link

* Windows images.

* Android images.

* Rename image.

* Resize image.

* VSMac Android images.

* More images.

* Edits.

* Edits.
  • Loading branch information
davidbritch authored Nov 10, 2023
1 parent a4fb674 commit a5bd422
Show file tree
Hide file tree
Showing 33 changed files with 26 additions and 23 deletions.
30 changes: 21 additions & 9 deletions docs/get-started/first-app.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
title: "Build your first .NET MAUI app"
description: "Learn how to create and run your first .NET MAUI app in Visual Studio 2022 on Windows, or Visual Studio 2022 for Mac."
ms.date: 11/01/2022
ms.date: 11/10/2023
zone_pivot_groups: devices-deployment
monikerRange: ">=net-maui-8.0"
---

# Build your first app
Expand All @@ -15,7 +16,7 @@ In this tutorial, you'll learn how to create and run your first .NET Multi-platf

## Prerequisites

- Visual Studio 2022 17.3 or greater, with the .NET Multi-platform App UI workload installed. For more information, see [Installation](installation.md?tabs=vswin).
- Visual Studio 2022 17.8 or greater, with the .NET Multi-platform App UI workload installed. For more information, see [Installation](installation.md?tabs=vswin).

## Create an app

Expand Down Expand Up @@ -116,9 +117,9 @@ In this tutorial, you'll create your first .NET MAUI app in Visual Studio 2022 a

:::image type="content" source="media/first-app/vs/android-device-manager.png" alt-text="Android Device Manager window.":::

01. In the Visual Studio toolbar, press the **Pixel 5 - API 30 (Android 11.0 - API 30)** button to build and run the app:
01. In the Visual Studio toolbar, press the **Pixel 5 - API 34 (Android 14.0 - API 33)** button to build and run the app:

:::image type="content" source="media/first-app/vs/pixel5-api30.png" alt-text="Pixel 5 API 30 emulator button.":::
:::image type="content" source="media/first-app/vs/pixel5-api-34.png" alt-text="Pixel 5 API 34 emulator button.":::

Visual Studio will start the Android emulator, build the app, and deploy the app to the emulator.

Expand All @@ -127,7 +128,7 @@ In this tutorial, you'll create your first .NET MAUI app in Visual Studio 2022 a
01. In the running app in the Android emulator, press the **Click me** button several times and observe that the count of the number of button clicks is incremented.

:::image type="content" source="media/first-app/vs/running-app.png" alt-text="App running in the Android emulator." lightbox="media/first-app/vs/running-app-large.png":::
:::image type="content" source="media/first-app/vs/android-running-app.png" alt-text="App running in the Android emulator.":::

## Troubleshooting

Expand Down Expand Up @@ -205,11 +206,14 @@ If your app fails to compile, review [Troubleshooting known issues](../troublesh
# [Visual Studio for Mac](#tab/vsmac)
<!-- markdownlint-enable MD025 -->

[!INCLUDE [Visual Studio for Mac end of life](~/includes/vsmac-eol-net8.md)]
[!INCLUDE [Visual Studio for Mac end of life](~/includes/vsmac-eol.md)]

## Prerequisites

- Visual Studio 2022 for Mac 17.4 or greater, with the .NET, .NET MAUI, Android, and iOS workloads installed. For more information, see [Installation](installation.md?tabs=vsmac).
- Visual Studio 2022 for Mac 17.6 with the .NET, .NET MAUI, Android, and iOS workloads installed. For more information, see [Installation](installation.md?tabs=vsmac).

> [!IMPORTANT]
> To use Visual Studio for Mac with .NET 8, enable the **Visual Studio > Preferences > Other > Preview Features > Use the .NET 8 SDK if installed (requires restart)** checkbox.
## Create an app

Expand Down Expand Up @@ -282,7 +286,7 @@ In this tutorial, you'll create your first .NET MAUI app in Visual Studio 2022 f

:::image type="content" source="media/first-app/vsmac/android-device-manager.png" alt-text="Close the Android Device Manager window.":::

01. In the Visual Studio 2022 for Mac toolbar, change the debug target to **Pixel 5 - API 31 (API 31)**:
01. In the Visual Studio 2022 for Mac toolbar, change the debug target to **Pixel 5 - API 34 (API 34)**:

:::image type="content" source="media/first-app/vsmac/android-pixel5-debug-target.png" alt-text="Set the created Android emulator as the debug target.":::

Expand Down Expand Up @@ -322,12 +326,20 @@ In this tutorial, you'll create your first .NET MAUI app in Visual Studio 2022 f
:::zone pivot="devices-maccatalyst"

<!-- markdownlint-disable MD029 -->
06. In the Visual Studio 2022 for Mac toolbar, ensure that the debug target is set to **My Mac**:
06. In the Visual Studio 2022 for Mac toolbar, ensure that the debug target is set to **My Mac (MacCatalyst)**:

:::image type="content" source="media/first-app/vsmac/mac-debug-target.png" alt-text="Ensure the debug target is set to My Mac.":::

<!-- markdownlint-enable MD029 -->

01. In Visual Studio 2022 for Mac, right-click on the **MyMauiApp** project and select **Edit Project File**. Then, in the project file editor insert the following XML before the first `<ItemGroup>`:

```xml
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-maccatalyst|AnyCPU'">
<RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers>
</PropertyGroup>
```

01. In the Visual Studio 2022 for Mac toolbar, press the **Play** button to launch the app on your Mac:

:::image type="content" source="media/first-app/vsmac/mac-run.png" alt-text="Launch the app on your Mac.":::
Expand Down
6 changes: 3 additions & 3 deletions docs/get-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ Alternatively, to deploy debug builds of your app directly from Windows to your
# [Visual Studio for Mac](#tab/vsmac)
<!-- markdownlint-enable MD025 -->

[!INCLUDE [Visual Studio for Mac end of life](~/includes/vsmac-eol-net8.md)]
[!INCLUDE [Visual Studio for Mac end of life](~/includes/vsmac-eol.md)]

To start developing native, cross-platform .NET MAUI apps on macOS, install Visual Studio 2022 for Mac 17.4 or greater by following the [installation](#installation) steps.
To start developing native, cross-platform .NET MAUI apps on macOS, install Visual Studio 2022 for Mac 17.6 by following the [installation](#installation) steps.

## Prerequisites

- Visual Studio 2022 for Mac 17.4 or greater. For information about supported operating systems, hardware, supported languages, and additional requirements and guidance, see [Visual Studio 2022 for Mac System Requirements](/visualstudio/releases/2022/mac-system-requirements).
- Visual Studio 2022 for Mac 17.6. For information about supported operating systems, hardware, supported languages, and additional requirements and guidance, see [Visual Studio 2022 for Mac System Requirements](/visualstudio/releases/2022/mac-system-requirements).

To build, sign, and deploy .NET MAUI apps for iOS or macOS, you'll also need:

Expand Down
Binary file modified docs/get-started/media/first-app/vs/additional-information.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/get-started/media/first-app/vs/android-debug-target.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/get-started/media/first-app/vs/android-device-manager.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/get-started/media/first-app/vs/ios-chosen-debug-target.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/get-started/media/first-app/vs/ios-debug-target.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/get-started/media/first-app/vs/ios-running-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/get-started/media/first-app/vs/new-android-device.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/get-started/media/first-app/vs/pixel5-api30.png
Binary file not shown.
Binary file modified docs/get-started/media/first-app/vs/restored-dependencies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file removed docs/get-started/media/first-app/vs/running-app.png
Binary file not shown.
Binary file modified docs/get-started/media/first-app/vs/windows-debug-target.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/get-started/media/first-app/vs/windows-run-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/get-started/media/first-app/vs/windows-running-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/get-started/media/first-app/vsmac/android-pixel5-run.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/get-started/media/first-app/vsmac/ios-debug-target.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/get-started/media/first-app/vsmac/ios-run.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/get-started/media/first-app/vsmac/mac-debug-target.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/get-started/media/first-app/vsmac/mac-run.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 0 additions & 9 deletions docs/includes/vsmac-eol-net8.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/windows/deployment/publish-visual-studio-folder.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This article describes how to use Visual Studio to publish your .NET MAUI app fo

In Visual Studio, you can only publish to one platform at a time. The target platform is selected with the **Debug Target** drop-down in the Visual Studio toolbar. Set the target to **Windows Machine** or to **Framework** > **net8.0-windows**, as illustrated in the following image:

:::image type="content" source="media/publish-visual-studio/vs-debugtarget-net7.png" alt-text="Selecting the Windows debug target for a .NET MAUI app in Visual Studio.":::
:::image type="content" source="media/publish-visual-studio/vs-debugtarget-net8.png" alt-text="Selecting the Windows debug target for a .NET MAUI app in Visual Studio.":::

## Publish the project

Expand Down
2 changes: 1 addition & 1 deletion docs/windows/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Developer Mode is enabled in **Settings** app, under **Update & Security** > **F

In Visual Studio, set the **Debug Target** to **Framework (...)** > **net8.0-windows**. There is a version number in the item entry, which may or may not match the following screenshot:

:::image type="content" source="media/setup/vs-target-windows-net7.png" alt-text="Visual Studio debug target set to Windows for .NET MAUI app.":::
:::image type="content" source="media/setup/vs-target-windows-net8.png" alt-text="Visual Studio debug target set to Windows for .NET MAUI app.":::

<!--
## Start Menu entry
Expand Down

0 comments on commit a5bd422

Please sign in to comment.