Closed arteeh closed 3 months ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Already tried:
dotnet workload update
dotnet new -i Microsoft.Maui.Templates
I actually did experience this issue #19489 earlier, but now I can't reproduce it anymore. I saw it when I tried to run my old app which started this troubleshooting journey, and I think I saw it with a fresh template as well. Maybe it's gone because I ran dotnet new -i Microsoft.Maui.Templates
?
But I just get crashes and InvalidProgramExceptions now.
The problem was that I needed a certain Windows SDK. Probably Windows 10 10.0.19041.0, but I just installed all of them. You can find it under the 'Desktop development with C++' section (or Individual components) (makes sense for something maui clearly depends on).
Now both the templates and my old project run properly, including on my android emulator.
Description
When I create a new Blazor Hybrid app with Visual Studio and launch it on Windows (unchanged), I get an exception on line 9 of MauiProgram.cs (
var builder = MauiApp.CreateBuilder();
):System.InvalidProgramException: 'Common Language Runtime detected an invalid program.'
Exception source: Microsoft.Extensions.DependencyInjection.Abstractions
The program crashes after I continue.
Tried in Jetbrains Rider as well, got the same exception but in App.g.i on line 75 (
if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
)When I debug the template in Android 11 emulator, the app crashes on startup and my output says this:
Steps to Reproduce
Android:
Jetbrains Rider:
Link to public reproduction project repository
No response
Version with bug
8.0.40 SR5
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows, I was not able test on other platforms
Affected platform versions
No response
Did you find any workaround?
No
Relevant log output
No response