maui
How can I remove the platforms I do not need to compile for in .net MAUI?
Required Change In your .csproj file, remove the targets for the platforms you aren’t building for, reducing it to the following: <TargetFrameworks>net6.0-maccatalyst</TargetFrameworks> <TargetFrameworks Condition=”$([MSBuild]::IsOSPlatform(‘windows’))”>$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks> Optional Changes In your .csproj file, remove the supported version information for the platforms you aren’t building for, reducing it to the following: <SupportedOSPlatformVersion Condition=”$([MSBuild]::GetTargetPlatformIdentifier(‘$(TargetFramework)’)) == ‘maccatalyst'”>14.0</SupportedOSPlatformVersion> <SupportedOSPlatformVersion Condition=”$([MSBuild]::GetTargetPlatformIdentifier(‘$(TargetFramework)’)) == ‘windows'”>10.0.17763.0</SupportedOSPlatformVersion> … Read more
New .Net MAUI App project throws ‘The name ‘InitializeComponent’ does not exist in the current context’ build errors
I faced the same issue and looks like when I created a ContentPage in VS its still pointing to Xamarin Forms. After changing namespace to MAUI, I updated the Build Action(RightClick on Xaml Page>>Properties>>BuildAction) of XAML Page to MauiXaml and it worked for me.
What is MAUI? and what are differences between MAUI and Xamarin
With .NET 5 Microsoft begins the journey of unifying the .NET platform, bringing .NET Core and Mono/Xamarin together in one base class library (BCL) and toolchain (SDK), more about it here. .NET MAUI is a name for a new upgraded solution as a Multi-platform App UI framework for building native cross-platform apps with .NET for … Read more