当前位置:网站首页>(01). Net Maui actual construction project
(01). Net Maui actual construction project
2022-06-13 00:46:00 【Dotnet cross platform】
1. Summary
This series of articles will address .NET MAUI Some contents of actual development , I will continuously update what I have learned for a long time . When learning new software development techniques , Will start with infrastructure projects MAUI No exception .
ref:https://docs.microsoft.com/zh-cn/dotnet/maui/get-started/first-app?pivots=devices-windows
This article will share the following :
1.VS Version selection for ( This content is too simple to handle directly )
2. Build project ( This content is too simple to handle directly )
3. understand MAUI Project structure ( Key content )
4.DEBUG Catalog
2. The detailed content
(1)VS Version selection
At present, this article uses a preview version of visual studio 2022, The official version will be gradually improved MAUI Project template creation .
Download address :https://c2rsetup.officeapps.live.com/c2r/downloadVS.aspx?sku=Community&channel=Preview&Version=VS2022&source=VSLandingPage&add=Microsoft.VisualStudio.Workload.CoreEditor&add=Microsoft.VisualStudio.Workload.NetCrossPlat;includeRecommended&cid=2302
install Visual Studio Or modify the installation , And install... Using the default optional installation options .NET Multi-platform application UI Development workload :

(2) Construction project
start-up Visual Studio 2022 17.3 preview , Then click... In the start window “ Create a new project ” To create a new project :

stay “ Create a new project ” Window , choice “ All project types ” In the drop-down list MAUI, choice .NET MAUI application Templates , And then click “ next step ” Button :

stay “ Configure new projects ” Window , Name the project , Choose the right location for it , And then click “ establish ” Button :

Wait for the project to be created and its dependencies restored :

stay Visual Studio In the toolbar , Use “ Debugging objectives ” Drop down list selection frame , And then choose net6.0-windows entry ( What needs to be specified here is the selection windows The platform can avoid installing simulators ):

stay Visual Studio In the toolbar , Press Windows Computer Button to generate and run the application :

If developer mode is not enabled ,Visual Studio You will be prompted to enable it . stay “ by Windows Enable Developer mode ” In the dialog box , single click Developer settings To open the settings application :

In the settings app , open Developer mode And accept the disclaimer :

Close the settings application , Then close it “ by Windows Enable Developer mode ” Dialog box .
In a running application , Multiple press “ Click me ” Button , And watch the count of button clicks increase :

(3) Interpretation of project structure
rely on

open MAUI The project structure is red “ rely on ” when , Can see 4 References to platforms , Android 、 Apple 、windows、mac. as for linux The platform needs to know the project address :https://github.com/jsuarezruiz/maui-linux be based on GtkSharp add to Linux Support .
Platforms

Main program classes for different platforms . In the latest release, it is worth mentioning that , In the picture above we can see Tizen Update . Let's see Tizen What is it? ?


In this update, you can see the update of this platform , in the future MAUI It is likely to be used in the on-board system . If it can be applied in this way , It has to be said that Microsoft is not prepared to leave opportunities for other technologies . In the future, I will continue to pay attention to whether this line is really so .
Resources

The meaning of this folder is very obvious. I won't explain it one by one , This point is for novice developers . Undoubtedly, some coding specifications have been formulated , The resources of are stored in the corresponding folder for centralized management .
xaml

app.xaml , This is the setup MAUI The default startup form and other operations , The usage here will be explained in subsequent articles .

MainPage.xaml It's like wpf Of mainwindo 了 , Write form code , Layout control .

MauiProgram.cs It's very similar here asp.net The start of class , You can add injection components or set Fonts 、 Contents of platform configuration .

Here you can see , It can be used #if To determine which corresponding configurations the current platform should start . The usage here is also important .
(4)Debug Catalog

When our program is finished , Can be in debug See the files of the corresponding platform under the directory . It should be noted here that only the version folder corresponding to the compilation can contain content . The following articles will tell you how to compile and formulate the platform version through commands . Here I use windows For example, the platform can directly see the executable file .

When we F5 Have run MAUI After that, you can also “win” You can see the startup shortcut in the Startup menu of .

I hope you will pay more attention to my wechat official account and b Station account will update video and articles . Thank you for watching .
边栏推荐
- Development notes of Mongoose
- Easyexcel read excel simple demo
- 6.824 Lab 1: MapReduce
- Using com0com/com2tcp to realize TCP to serial port (win10)
- Delphi2009 connecting Oracle11g
- Summary of openstack installation problems
- The seventh finals of the Blue Bridge Cup
- In / out / inout details of MySQL stored procedures
- MySQL queries the quantity of each month and the year-on-year and month on month data of each month
- [GXYCTF2019]禁止套娃--详解
猜你喜欢

今日睡眠质量记录74分

.net core 抛异常对性能影响的求证之路
![[MRCTF2020]Ez_ bypass --BUUCTF](/img/73/85262c048e177968be67456fa4fe02.png)
[MRCTF2020]Ez_ bypass --BUUCTF

Another year 1024, happy programmer's Day!

Cve-2021-24078 vulnerability analysis

A simple deadlock example

Kali system -- dnsrecon for DNS collection and analysis

Penetration test summary

Hard (magnetic) disk (I)

antdPro - ProTable 实现两个选择框联动效果
随机推荐
The origin of MySQL in bedtime stories
Kotlin 协程,job的生命周期
Assembly language learning
Kali system -- fierce of DNS collection and analysis
【SCA-CNN 解读】空间与通道注意力:Spatial and Channel-wise Attention
高阶极点对于波形的影响
Blinker FAQs
[GYCTF2020]Ezsqli --BUUCTF
kotlin 协程withContext切换线程
What is dummy change?
Download nail live playback through packet capturing
MCU serial port interrupt and message receiving and sending processing -- judge and control the received information
Android Weather
Using com0com/com2tcp to realize TCP to serial port (win10)
Kotlin 协程挂起函数 suspend 关键字
Static analysis of malicious code
Solution to the problem of closing the watchdog of STM32 in the sleep mode (stop/standby)
为什么磁盘分区的时候,第一个分区前面总有一段空间(63或者2048个扇区)
Why is there always a space (63 or 2048 sectors) in front of the first partition when partitioning a disk
MySQL locates the position of the character in the string String substitution