Unfortunately, the .NET MAUI templates no longer support those per-platform flags (like --ios false, --android false, etc.) in dotnet new maui-blazor. If you try them, you’ll see the “invalid option” error you encountered.
The practical way to get a “Windows + macOS only” .NET MAUI Blazor app is:
- Create the default .NET MAUI Blazor project.
- Remove the unwanted platform targets (Android, iOS, Tizen, etc.) from the project file.
Below is a step-by-step guide.
From your terminal or command prompt, run:
dotnet new maui-blazor -n MyHybridApp
This creates a multi-targeted MAUI Blazor app named MyHybridApp. By default, it includes iOS, Android, macOS (via Mac Catalyst), and Windows.
Inside the new MyHybridApp folder, open MyHybridApp.csproj in your favorite editor. You should see something like:
<Project Sdk="Microsoft.NET.Sdk">
net8.0-windows10.0.19041.0
Remove the lines for the platforms you don’t want. For example, if you only want macOS and Windows, change it to:
net8.0-windows10.0.19041.0
Now your project only targets macOS (Catalyst) and Windows.
If you want to keep your repo extra clean, you can also delete any platform-specific folders you’re not using (e.g. Platforms/Android or Platforms/iOS). It’s optional because they won’t be compiled if the target frameworks aren’t in your .csproj.
On Windows, you can build and run for Windows:
dotnet build -f net8.0-windows10.0.19041.0
dotnet run -f net8.0-windows10.0.19041.0
On macOS, build and run for Mac Catalyst:
dotnet build -f net8.0-maccatalyst
dotnet run -f net8.0-maccatalyst
There’s no single command-line to skip iOS/Android/Tizen up front anymore. Instead, generate the standard .NET MAUI Blazor project and manually remove the platform targets you don’t want from the .csproj. That’s the standard, recommended approach as of .NET 7/8.