Skip to content

[nativeaot] RuntimeHostConfigurationOption set in Tasks aren't included in AppContext during runtime #10137

Open
@emmauss

Description

@emmauss

Android framework version

net10.0-android (Preview)

Affected platform version

Main as of 288f107

Description

Building a native aot android project with a task that sets RuntimeHostConfigurationOption will not have the options set in AppContext during runtime. A task like this will run fine and shows in binlogs, but the values aren't available at runtime

  <Target Name="TestTask"
            BeforeTargets="CoreCompile">
        <ItemGroup>
              <RuntimeHostConfigurationOption Include="TestVar" Value="A" />
        </ItemGroup>
  </Target>

Steps to Reproduce

  1. Build and run https://github.com/emmauss/AndroidNativeAOTTest/tree/task_test
  2. When app launches, the follow should show in the button text: "Hello. Task Var:A", but instead, it shows "Hello. Task Var:", with no "A".
  3. You can test with mono by disabling "PublishAot" in project properties.

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions