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

Publish NativeAOT failed with .NET 9 #15646

Closed
noliar opened this issue May 7, 2024 · 3 comments · Fixed by #15705
Closed

Publish NativeAOT failed with .NET 9 #15646

noliar opened this issue May 7, 2024 · 3 comments · Fixed by #15705

Comments

@noliar
Copy link

noliar commented May 7, 2024

Describe the bug

publish aot failed with .NET 9 and 11.1.0-beta2.
image

To Reproduce

  1. install .NET 9 nightly
  2. Install latest Avalonia templates
  3. update packages version to 11.1.0-beta2
  4. set PublishAot to true
  5. publish

image

Expected behavior

publish nativeaot with .NET 9 successfully.

Avalonia version

11.1.0-beta2

OS

Windows

Additional context

sample repo: https://github.com/noliar/AvaloniaTest
github action results: https://github.com/noliar/AvaloniaTest/actions/runs/8987494959

build avalonia(version: 11.1.0-beta1) with .NET 9 is ok.
build avalonia(version: 11.1.0-beta2) with .NET 9 is failed.
build avalonia(version: 11.1.0-beta1) with .NET 8 is ok, but run failed.
build avalonia(version: 11.1.0-beta2) with .NET 8 is ok.

related: #14966

@maxkatz6
Copy link
Member

@MrJul should we add an sdk check in the InjectIlcAvaloniaXamlOutput target?

@kekekeks
Copy link
Member

We can probably add <ManagedBinary Remove="@(_AvaloniaXamlCompiledAssembly)" /> before <ManagedBinary Include="@(_AvaloniaXamlCompiledAssembly)" /> (as long as SDK doesn't set any item properties)

@MrJul
Copy link
Member

MrJul commented May 13, 2024

Both would work, but my preference goes to checking the SDK version, as the workaround shouldn't be needed anymore (and should be removed down the road). I think it's better than maintaining a hack for several different SDK versions :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants