.NET MAUI installation with already installed Visual Studio 2022
.NET Multi-platform App UI (.NET MAUI) is an open source, cross-platform framework for creating native mobile and desktop apps with C# and XAML. You can read more about this on Microsoft learn website.
I recently started using it for one of my project. Installing MAUI is fairly easy and straight forward when you do not have Visual Studio(VS) already installed in your system. But if VS is already installed in you system, then finding steps to install MAUI is not easy to find.
In this article, I will introduce you with one of the way to install .NET MAUI if you have VS already installed. I found this way the most convenient.
Pre-requisite: You should have the visual studio installer file in your system.
[NOTE: Some people delete the installer files after installation, in that case download the installer file from below link. https://visualstudio.microsoft.com/downloads/ ]
Steps
- Find visual studio installer in you system.
2. Click on the installer to install Visual Studio.
I know it might sound confusing, but trust me and keep going.
You will see below screen, now click on continue.
3. Select Multi-platform App UI
You can select all the other options if you require those for your project.
Now click on Install and Update. It will start the installation.
Once the installation is complete, open visual studio and try to create a new MAUI project.
4. Lets create .NET MAUI project.
Click on new
Here we can see Multiplatform in left nav bar. Select your choice of form and click on continue.
Enter your project name and click on continue. [NOTE: Here I have selected both Android and iOS as Target platforms. You can choose to select any one of them.]
If you wish to update the location of the project you can change it on this step. But an optional step.
Now click on create.
The project will open in VS.
Here you can see few warnings on left side of the screen. You might get this error if you had selected iOS as one of the target platform.
To resolve this we need to download Xcode. If you do not have Xcode already installed, you can click on the download option to download Xcode. If you had already installed Xcode from App store (on mac), click on “Go to Preferences”. It will automatically pick the correct location and ask you to restart Visual Studio.
I had already installed the Xcode from App store.
Now Restart the VS.
You can see all the warnings are gone!
Woohhooo!! We successfully installed .NET MAUI in Visual Studio. And we are ready to code our new project in MAUI in Visual Studio.
Please feel free to post your queries in comments. Happy to help!