From the course: Xamarin Essential Training: Create Your First App

Set up Windows for development

- [Instructor] To get started with Xamarin development on a Windows machine, you're going to want to install Visual Studio. Now I've got Visual Studio Professional 2022 here. You can work with Community as well which is what I'll use over on the Mac. I've already got it installed but I'm going to go ahead and click modify. This is a similar kind of dialogue or choices you'll have when installing Visual Studio. You can see that along with some of my web and cloud development here, I've also got desktop and mobile at the bottom. So I've selected the .NET multi-platform app UI development or MAUI, which might be a little confusing based on the conversation we had earlier. But that's also going to give me all the tools I need for native Xamarin development for Android, iOS, and Windows. I also got the .NET desktop development here. If I want to build, say, a WPF or Windows Forms application. Now those are the major workloads, they're called, kind of the big buckets of functionality that we can choose here. There's some other tool sets down here as well. And we can also go to the individual components tab here. The other thing to notice is the installation details. Now, if I expand this .NET multi-platform app UI development, you'll see that it's got some of the core pieces here that are included, like that .NET Maui, MSBuild, things that are required. But it also has optional components. You can see that Xamarin is checked there along with IntelliCode. When we go to the individual components, this is where you can add additional items to your Visual Studio installation beyond the core workload. So the .NET MAUI pieces are already checked. You can see there's a number of things here that are already selected. We're going to go down here. We've got development and we've got emulators. I'll talk a little bit about this Intel Hardware Accelerated Execution Manager or HAXM in the next section about Android development. But I've got it enabled here cause I'm going to use that for my Android emulator. Notice that even though I don't have the Google Android emulator checked here, I am going to have an emulator that I can run my Android applications on. I've added a couple other items on the individual components here. You can see I have the Windows 10 SDK on the right hand side here and I've done that so that I have support for WinUI 3, That's the newest framework for building native desktop applications for Windows, and that's what I'm going to use later to build our Windows application. Now, if I'd made any changes here, done anything that needed updates, I could install and update that. And then once that completes here on the installer dialogue I'd be ready to go and launch my Visual Studio and get started. So we come out and create a new application. One of the things you should see is if I pick, for example, C# and I go to Android, and I'll change this to all project types, you'll see I have class library, I have a mobile app with Xamarin Forms, I've got an Android app with Xamarin. That's the model that we'll be working with here. And I've got other items there for class libraries, binding libraries, and other application types that I can use. So let's go ahead and select an Android app. Right now I'm just going to call this App1. We're not going to do anything with this other than just to see the IDE, create this application. I'll call it a single view app. Then we'll go ahead and just pick the latest version of Android here and get that created. So I can see that I have an application. It's got all of the Xamarin components set up. I'm working with Android here in Visual Studio on my Windows machine. So those are the key components you'll need to install in Visual Studio in order to be able to do that Xamarin development. And we'll look at specifically Android and iOS development next.

Contents