-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
iOS Blazor app crashes with TargetPlatformVersion=15.4 #10958
Comments
@rolfbjarne from the details provided here it doesn't seem to be Blazor specific. Did you actually confirm that or should someone from the MAUI look into this instead? |
@mkArtakMSFT I first tried to reproduce with a plain MAUI app (no Blazor), and wasn't able to (but maybe I just didn't try hard enough). I guess whomever is responsible for the Microsoft.AspNetCore.Components.WebView.Maui assembly should look at it? |
Given the call stack is entirely .NET MAUI, could you please clarify why you believe the Microsoft.AspNetCore.Components.WebView.Maui assembly is the culprit here? |
@TanayParikh I created created two apps, one that worked and one that didn't. Then I copied the Microsoft.AspNetCore.Components.WebView.Maui.dll between them, and if I copied the version from the failing app to the working app, the working app started failing, and when I did the reverse, the failing app started working. |
Verified this issue with Visual Studio Enterprise 17.6.2 build (405), Can repro on iOS platform with sample project. Test-8a5a3f4.zip |
@rolfbjarne is there a real-world scenario that you can think of which will lead customers to hitting this? In the last 2 years we've seen no customers complaining about this. So it's not clear if we should actually spend time on it. |
@mkArtakMSFT this was originally reported by an (internal) customer. Looking at the most recent NuGet, I see that the problem can still occur: https://nuget.info/packages/Microsoft.AspNetCore.Components.WebView.Maui/8.0.14 now if the customer sets TargetPlatformVersion=17.0 in their csproj, they'll get the generic The good news is that we're working on making this easy to fix, once dotnet/sdk#30103 is fixed and published, the fix should be as easy as adjusting the TargetFramework in the corresponding csproj from |
Great, thanks @rolfbjarne. |
Description
Exception at startup:
Steps to Reproduce
Test project: Test-8a5a3f4.zip
Alternatively:
dotnet new maui-blazor
TargetPlatformVersion
to15.4
Binlog:
msbuild.binlog.zip
The underlying reason for the crash is that a different
Microsoft.AspNetCore.Components.WebView.Maui.dll
assembly is picked by the build.In the crashing version, this version is used:
While the working assembly comes from:
Note that the target framework is different in the path:
net6.0
vsnet6.0-ios16.0
– the crashing app is picking up the general .NET 6 version of this assembly, and not the one with iOS-specific code.This is because of the TargetPlatformVersion property in the project file: if this is set to lower than 16.0, the general .NET 6 version of the assembly is picked, but if it’s 16.0 (or higher), then the
net6.0-ios16.0
version is picked. As far as I can tell this is working as expected (if you’re building with the iOS 15.4 API for instance, you can’t expect to consume an assembly that potentially uses iOS 16.0 API).Another point of interest is that the 6.0.540 version of this NuGet has a
net6.0-ios15.4
assembly, which would presumably work fine: https://nuget.info/packages/Microsoft.AspNetCore.Components.WebView.Maui/6.0.540So I'm not sure where the bug is, but in any case the crash a terrible way to report this problem. It took me quite a few hours to track it down, and I wouldn't expect customers to be able to without even more time wasted.
Link to public reproduction project repository
See zip above
Version with bug
7.0 Release Candidate 2
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 16
Did you find any workaround?
Set TargetPlatformVersion to 16.0:
Relevant log output
The text was updated successfully, but these errors were encountered: