maui: Upgrading to 8.0.0-rc.2.9511 breaks the app. Loses references to MauiUIApplicationDelegate


Issue moved from dotnet/sdk#36667


From @fady-intelligencex on Saturday, November 4, 2023 7:01:32 PM

Description

Once I upgraded to 8.0.0-rc.2.9511, the app stopped building with the Error CS0246: The type or namespace name ‘MauiUIApplicationDelegate’ could not be found (are you missing a using directive or an assembly reference?) (CS0246). To validate, I created a new project. It works fine with the a previous version, but once I upgrade, it has the same problem.

Steps to Reproduce

  1. Create new project in maui .net 8.0
  2. Run the project
  3. Update Microsoft.Maui.Controls to 8.0.0-rc-2.9511
  4. Attempt to run project
  5. see error in the build output.

under Platforms/iOS/ in the file AppDelegate.cs

using Foundation;

namespace newtest4;

[Register(“AppDelegate”)] public class AppDelegate : MauiUIApplicationDelegate { protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); }

It cannot find: MauiUIApplicationDelegate

I shared a video link where I demo it happening on a new project.

Link to public reproduction project repository

https://youtu.be/aBUKjdeMXz8

Version with bug

8.0.0-rc.2.9511

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.0-rc.1.9171

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

N/A

Relevant log output

Projects/newtest4/newtest4/Platforms/iOS/AppDelegate.cs(28,28): Error CS0246: The type or namespace name 'MauiUIApplicationDelegate' could not be found (are you missing a using directive or an assembly reference?) (CS0246) (newtest4)

About this issue

  • Original URL
  • State: closed
  • Created 8 months ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

I have this issue as well.

Just installed .NET 8 GA with the workloads below, but still issues.

Installed Workload Id      Manifest Version      Installation Source
--------------------------------------------------------------------
maui                       8.0.3/8.0.100         SDK 8.0.100        
 The type or namespace name 'MauiUIApplicationDelegate' could not be found (are you missing a using directive or an assembly reference?)

Edit: It seems like the same issue is also happening to ViewRenderer.

The type or namespace name 'ViewRenderer<,>' could not be found (are you missing a using directive or an assembly reference?)