Hi,
Target: move maui app from .net 8 to .net 9 in Mac.
Documentation:
https://learn.microsoft.com/en-us/dotnet/maui/whats-new/dotnet-9?view=net-maui-9.0#upgrade-from-net-8-to-net-9
Problem:App not working without debugging.
Steps:
- I did all steps in documentation.
- Update Nuget packages.
- My final Nuget packages in cs proj is:
- <ItemGroup> <PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" /> <PackageReference Include="CommunityToolkit.Maui" Version="9.0.0" /> <PackageReference Include="System.Management" Version="9.0.1" /> <PackageReference Include="Telerik.UI.for.Maui" Version="9.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="8.0.0" /> <PackageReference Include="Autofac" Version="8.2.0" /> <PackageReference Include="DotNetZip" Version="1.16.0" /> </ItemGroup> <!-- Windows --> <ItemGroup Condition="$(TargetFramework.Contains('-windows')) == true"> <PackageReference Include="WindowsAPICodePack" Version="8.0.6" /> </ItemGroup>
- Still problem exist , why ?
In debug that it working I got this error:
Exception has occurred: CLR/System.InvalidOperationException
An unhandled exception of type 'System.InvalidOperationException' occurred in Microsoft.MacCatalyst.dll: 'Window was already destroyed'
at UIKit.UIApplication.xamarin_UIApplicationMain(Int32 argc, IntPtr argv, IntPtr principalClassName, IntPtr delegateClassName, IntPtr* gchandle)
at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName)
at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass)
at GoodDesktopClient.Maui.Program.Main(String[] args) in