xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.42k stars 507 forks source link

Simple net8.0-ios app deployed to with Visual Studio "local device" => "No class inheriting from a valid Application Delegate found in ..." #20658

Closed gentledepp closed 2 weeks ago

gentledepp commented 1 month ago

Steps to Reproduce

  1. I created 3 repros here: https://github.com/gentledepp/Repro_AvaloniaiOSCrash
  2. Run any of the iOS projects deploying with VS directly to a local device

Expected Behavior

The app starts and shows "hello avalonia" or the like

Actual Behavior

We get the error No class inheriting from a valid Application Delegate found in ... image

Environment

Version information ``` Microsoft Visual Studio Community 2022 Version 17.9.7 VisualStudio.17.Release/17.9.7+34902.65 Microsoft .NET Framework Version 4.8.09032 Installed Version: Community Visual C++ 2022 00482-90000-00000-AA988 Microsoft Visual C++ 2022 ASP.NET and Web Tools 17.9.199.22661 ASP.NET and Web Tools Azure App Service Tools v3.0.0 17.9.199.22661 Azure App Service Tools v3.0.0 Azure Functions and Web Jobs Tools 17.9.199.22661 Azure Functions and Web Jobs Tools C# Tools 4.9.0-3.24121.1+a98c90d56455379836dd5c845b35fa932b00cfa3 C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools. Extensibility Message Bus 1.4.39 (main@e8108eb) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration. GitHub Copilot 1.156.0.0 (v1.156.0.0@82fafb995) GitHub Copilot is an AI pair programmer that helps you write code faster and with less work. GitHub Copilot Agent 1.156.0 Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines Mono Debugging for Visual Studio 17.9.0 (b3bca6f) Support for debugging Mono processes with Visual Studio. NuGet Package Manager 6.9.2 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/ Razor (ASP.NET Core) 17.9.2.2412004+684740676513b3b208d5bd5b7f8786dab8d287b7 Provides languages services for ASP.NET Core Razor. ResX Resource Manager ResXManager Manage localization of all ResX-based resources in one place. Shows all resources of a solution and lets you edit the strings and their localizations in a well-arranged data grid. SQL Server Data Tools 17.9.56.1 Microsoft SQL Server Data Tools TypeScript Tools 17.0.30103.2001 TypeScript Tools for Microsoft Visual Studio Visual Basic Tools 4.9.0-3.24121.1+a98c90d56455379836dd5c845b35fa932b00cfa3 Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Visual F# Tools 17.9.0-beta.23614.3+a521e1cd420beb56c15faf6836184fadd2b7937a Microsoft Visual F# Tools Visual Studio IntelliCode 2.2 AI-assisted development for Visual Studio. VisualStudio.DeviceLog 1.0 Information about my package VisualStudio.Mac 1.0 Mac Extension for Visual Studio WiX Toolset Visual Studio Extension 1.0.0.18 WiX Toolset Visual Studio Extension version 1.0.0.18 Copyright (c) .NET Foundation and contributors. All rights reserved. Xamarin 17.9.0.140 (d17-9@7ca5d58) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android. Xamarin Designer 17.9.3.0 (remotes/origin/d17-9@f174974f91) Visual Studio extension to enable Xamarin Designer tools in Visual Studio. Xamarin Templates 17.9.0 (38e87ba) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms. Xamarin.Android SDK 13.2.2.0 (d17-5/45b0e14) Xamarin.Android Reference Assemblies and MSBuild support. Mono: d9a6e87 Java.Interop: xamarin/java.interop/d17-5@149d70fe SQLite: xamarin/sqlite/3.40.1@68c69d8 Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-5@ca1552d Xamarin.iOS and Xamarin.Mac SDK 16.4.0.23 (9defd91b3) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support. ```

Build Logs

msbuild.zip

Example Project (If Possible)

https://github.com/gentledepp/Repro_AvaloniaiOSCrash use any of the 3 sample solutions (they are all "File-New" Avalonia XPat projects.

Even more interesting - there is a project AvaloniaMauiHybrid with two sample solutions

So I presume there is some "magic" going on to launch MAUI and Xamarin apps on a local device which does not support any other libraries such as Avalonia?

rolfbjarne commented 3 weeks ago

Simple net8.0-ios app deployed to with Visual Studio "local device"

We only support deploying MAUI projects to a local iOS device on Windows, so how were you able to do it? In theory VS shouldn't even give you an option to deploy to a local device unless you're using a MAUI project.

microsoft-github-policy-service[bot] commented 3 weeks ago

Hi @gentledepp. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

microsoft-github-policy-service[bot] commented 2 weeks ago

Hi @gentledepp. Due to inactivity, we will be closing this issue. Please feel free to re-open this issue if the issue persists. For enhanced visibility, if over 7 days have passed, please open a new issue and link this issue there. Thank you.