Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 opened this issue May 28, 2024 · 7 comments

Comments

@gentledepp
Copy link

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
Copy link
Member

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.

@rolfbjarne rolfbjarne added the need-info Waiting for more information before the bug can be investigated label Jun 7, 2024
@rolfbjarne rolfbjarne added this to the Future milestone Jun 7, 2024
Copy link
Contributor

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.

Copy link
Contributor

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.

@gentledepp
Copy link
Author

Hello!
Sorry for the late reply, I had some other issues to attend to. :-|

I have a repro for you: https://github.com/gentledepp/POC_AvaloniaMauiApp01/tree/master/POC_AvaloniaMauiApp01/POC_AvaloniaMauiApp01.iOS

I guess the reason is that I am using avalonia together with MAUI here.

The reason being, that Avalonia misses some important controls (camera and barcode scanner) which I have to "borrow" from Maui.

@rolfbjarne rolfbjarne reopened this Aug 1, 2024
@rolfbjarne rolfbjarne removed the need-info Waiting for more information before the bug can be investigated label Aug 1, 2024
@rolfbjarne
Copy link
Member

The problem is that when using a local device on Windows, it's required that the app's AppDelegate class subclasses MAUI's MauiUIApplicationDelegate class, and your AppDelegate subclasses AvaloniaAppDelegate:

https://github.com/gentledepp/POC_AvaloniaMauiApp01/blob/9cd892a20de492a4afe80c20c504e86bf7510305/POC_AvaloniaMauiApp01/POC_AvaloniaMauiApp01.iOS/AppDelegate.cs#L21C36-L21C55

Connecting to a remote Mac from Windows, or using a Mac directly, works fine though.

@rolfbjarne rolfbjarne closed this as not planned Won't fix, can't repro, duplicate, stale Aug 6, 2024
@gentledepp
Copy link
Author

Is there any chance you could add the option to, instead of needing to subclass MauiUIApplicationDelegate this would also work with implementing some interface or using some attribute? 👀
That would be so awesome - I would use Maui if I could, but it magnitues slower than xamarin forms for our usecase and brittle as ever... :-(

@rolfbjarne
Copy link
Member

Is there any chance you could add the option to, instead of needing to subclass MauiUIApplicationDelegate this would also work with implementing some interface or using some attribute? 👀 That would be so awesome - I would use Maui if I could, but it magnitues slower than xamarin forms for our usecase and brittle as ever... :-(

That would be a question for our Windows team - please file this using the Visual Studio for Windows feedback tool

Feel free to reference this issue in your feedback (and vice versa, that way we can quickly route it to the right team for their evaluation).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants