Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
lawrence_shaun_introducing_net_maui_build_and_deploy_crosspl.pdf
Скачиваний:
46
Добавлен:
26.06.2023
Размер:
5.15 Mб
Скачать

Chapter 2 Building Our First application

\1.\ Download and install Visual Studio 2022. This can be accessed from https://visualstudio. microsoft.com/downloads/.

\2.\ Run the installer and you will see the workload selection screen. Select the Mobile development with .NET workload. Figure 2-7 shows the Visual Studio Windows installer with the required .NET MAUI workloads checked.

Figure 2-7.  Visual Studio Windows installation options

Please refer to the Microsoft documentation page at https://learn. microsoft.com/dotnet/maui/get-started/installation?tabs=vswin if any of the installation options have changed.

Visual Studio to macOS

The final item to configure in your Windows environment is to set up the connection between Visual Studio and your macOS so that iOS and macOS builds can be compiled.

28

Chapter 2 Building Our First application

\1.\ Inside Visual Studio select the Tools menu item.

\2.\ Select iOS Pair to Mac.

\3.\ Check and confirm the firewall access. Figure 2-8 shows the firewall request dialog that is presented when first running Visual Studio on Windows.

Figure 2-8.  Windows firewall request

\4.\ Note that you may also see a second firewall popup for the Xamarin Broker.

\5.\ Select your Mac from the list.

\6.\ Click Connect. Figure 2-9 shows the Pair to Mac dialog that allows you to connect your Visual Studio running on Windows to connect to your macOS machine.

29

Chapter 2 Building Our First application

Figure 2-9.  Pair to Mac screen

\7.\ Enter the username and password that you use to log into your Mac.

\8.\ Wait for the tooling to connect and make sure that everything is configured on the Mac.

\9.\ When you see the symbol shown in Figure 2-10, your setup is complete. Figure 2-10 shows the Pair to Mac dialog with the connected symbol against your macOS machine.

30

Chapter 2 Building Our First application

Figure 2-10.  Pair to Mac screen with confirmation

\ 10.\ Visual Studio should now connect automatically when you open a .NET MAUI solution. Figure 2-11 shows the Pair to Mac button in Visual Studio on Windows.

Figure 2-11.  Visual Studio toolbar with Pair to Mac buttons

31