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

.NET 8 RC1 - Native AOT does not work with startup Blazor MAUI App #17715

Closed
strich opened this issue Sep 28, 2023 · 1 comment
Closed

.NET 8 RC1 - Native AOT does not work with startup Blazor MAUI App #17715

strich opened this issue Sep 28, 2023 · 1 comment
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView platform/windows 🪟 t/bug Something isn't working

Comments

@strich
Copy link

strich commented Sep 28, 2023

Description

I wanted to see if Blazor MAUI works well with native AOT and almost immediate ran into a showstopper when trying with the start up project after adding:

true

This is the compile error after running dotnet publish -f net8.0-windows10.0.19041.0:

error NU1101: Unable to find package runtime.linux-arm.Microsoft.DotNet.ILCompiler. No packages exist with this id in source(s): C:\Program Files\dotnet\library-packs, Microsoft Visual Studio Offline Packages, nuget.org

UPDATE 1:
I removed all the framework platform support in the csproj except for Windows (but why was it trying to compile for linux??) and now get this error at a later build stage:

EXEC : error : Specified cast is not valid. [D:\Programming\NET8MAUIBlazorApp\NET8MAUIBlazorApp\NET8MAUIBlazorApp.csproj::TargetFramework=net8.0-windows10.0.19041.0]
  System.InvalidCastException: Specified cast is not valid.
     at System.Runtime.TypeCast.ThrowInvalidCastException(MethodTable*) + 0x16
     at ILCompiler.MetadataManager.IsReflectionBlocked(TypeDesc) + 0x132
     at ILCompiler.MetadataManager.IsReflectionBlocked(Instantiation) + 0x3d
     at ILCompiler.MetadataManager.IsReflectionBlocked(TypeDesc) + 0xfc
     at ILCompiler.UsageBasedMetadataManager.HasConditionalDependenciesDueToEETypePresence(TypeDesc) + 0xee
     at ILCompiler.DependencyAnalysis.EETypeNode..ctor(NodeFactory, TypeDesc) + 0xff
     at ILCompiler.DependencyAnalysis.NodeFactory.CreateNecessaryTypeNode(TypeDesc) + 0xfa
     at Internal.TypeSystem.LockFreeReaderHashtable`2.CreateValueAndEnsureValueIsInTable(TKey) + 0x11
     at ILCompiler.DependencyAnalysis.NodeFactory.NecessaryTypeSymbol(TypeDesc) + 0xe7
     at ILCompiler.DependencyAnalysis.NonGCStaticsNode.GetConditionalStaticDependencies(NodeFactory) + 0x32
     at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.GetStaticDependenciesImpl(DependencyNodeCore`1) + 0xf3
     at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.GetStaticDependencies(DependencyNodeCore`1) + 0x2b
     at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.ProcessMarkStack() + 0xb5
     at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.ComputeMarkedNodes() + 0x50
     at ILCompiler.ILScanner.ILCompiler.IILScanner.Scan() + 0x14
     at ILCompiler.Program.<Run>g__RunScanner|4_0(Program.<>c__DisplayClass4_0&) + 0x191
     at ILCompiler.Program.Run() + 0x2444
     at ILCompiler.ILCompilerRootCommand.<>c__DisplayClass221_0.<.ctor>b__0(ParseResult result) + 0x315

Steps to Reproduce

  1. Create a new Blazor MAUI app in VS Preview
  2. Add this to csproj:
	<PropertyGroup>
		<PublishAot>true</PublishAot>
	</PropertyGroup>
  1. Run dotnet publish -f net8.0-windows10.0.19041.0

Link to public reproduction project repository

No response

Version with bug

8.0.0-rc.1.9171

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

@drasticactions
Copy link
Contributor

Duplicate of #17713, same error happens in both.

@drasticactions drasticactions closed this as not planned Won't fix, can't repro, duplicate, stale Sep 28, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Oct 28, 2023
@samhouts samhouts added the area-blazor Blazor Hybrid / Desktop, BlazorWebView label Aug 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView platform/windows 🪟 t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants