maui: [regression/8.0.0-preview.7.8842] System.TypeLoadException with .NET 8

Description

Getting the below errors when trying to run the Hello Maui app in .NET 8 on Mac.

This is just the basic Hello Maui click counter app with no modifications other than changing it to .NET 8.

Could not resolve type with token 0100001c from typeref (expected class ‘System.Runtime.CompilerServices.NullableAttribute’ in assembly ‘System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’)

StackTrace System.TypeLoadException: Could not resolve type with token 0100001a from typeref (expected class ‘System.Runtime.CompilerServices.NullableContextAttribute’ in assembly ‘System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’) string

Screenshot 2023-08-31 at 9 25 34 pm Screenshot 2023-08-31 at 9 25 34 pm (2)

Steps to Reproduce

Create new Maui app. Change TargetFramework to net8.0-ios Run Boom

Link to public reproduction project repository

No response

Version with bug

8.0.0-preview.7.8842

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

7.0.92

Affected platforms

iOS

Affected platform versions

iOS 15

Did you find any workaround?

No

Relevant log output

System.TypeLoadException: Could not resolve type with token 0100001c from typeref (expected class 'System.Runtime.CompilerServices.NullableAttribute' in assembly 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Reactions: 3
  • Comments: 52 (15 by maintainers)

Most upvoted comments

We are getting it this too using 8.0.0-rc.1.9149

  • in our real app - works in .net 7 but crashes the app when loading the main page - trying to isolate the issue but tricky - image

@AndreasReitberger I believe it released just minutes ago. 🤞

Just updated my app project to net8. Also seeing this issue on Android now. All is up to date using the latest versions of VS 2022 Preview and Net8.

Yeah I don’t see us being able to use .NET 8 for a while yet. If we still can’t even get the basic click counter to work there is little chance of getting a real app to work.

@samhouts We’ve released a couple of Prerelease channel updates of the MAUI DevKit recently so I suspect this issue has been cleared up, but we’ll keep an eye out. Thanks.