Skip to content

[xabt] support @(RuntimeEnvironmentVariable) items#10770

Draft
jonathanpeppers wants to merge 1 commit intomainfrom
dev/peppers/RuntimeEnvironmentVariable
Draft

[xabt] support @(RuntimeEnvironmentVariable) items#10770
jonathanpeppers wants to merge 1 commit intomainfrom
dev/peppers/RuntimeEnvironmentVariable

Conversation

@jonathanpeppers
Copy link
Member

Context: dotnet/sdk@bd5d3af

dotnet run now passes in dotnet run -e FOO=BAR as @(RuntimeEnvironmentVariable) MSBuild items.

To opt in to this new feature, we need to add:

<ProjectCapability Include="RuntimeEnvironmentVariableSupport" />

As well as update the _GenerateEnvironmentFiles MSBuild target:

<!-- RuntimeEnvironmentVariable items come from 'dotnet run -e NAME=VALUE' -->
<_GeneratedAndroidEnvironment Include="@(RuntimeEnvironmentVariable->'%(Identity)=%(Value)')" />

I added a new test to verify we have the env vars on-device at runtime.

Note that I tested this in combination with a local .NET SDK build:

We won't be able to merge this until we have a .NET SDK here that includes the above commit.

Context: dotnet/sdk@bd5d3af

`dotnet run` now passes in `dotnet run -e FOO=BAR` as
`@(RuntimeEnvironmentVariable)` MSBuild items.

To opt in to this new feature, we need to add:

    <ProjectCapability Include="RuntimeEnvironmentVariableSupport" />

As well as update the `_GenerateEnvironmentFiles` MSBuild target:

    <!-- RuntimeEnvironmentVariable items come from 'dotnet run -e NAME=VALUE' -->
    <_GeneratedAndroidEnvironment Include="@(RuntimeEnvironmentVariable->'%(Identity)=%(Value)')" />

I added a new test to verify we have the env vars on-device at runtime.

Note that I tested this in combination with a local .NET SDK build:

* #10769

We won't be able to merge this until we have a .NET SDK here that
includes the above commit.
@jonathanpeppers jonathanpeppers added the copilot `copilot-cli` or other AIs were used to author this label Feb 4, 2026
@jonathanpeppers
Copy link
Member Author

This is waiting on a .NET SDK that has the change:

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

Labels

copilot `copilot-cli` or other AIs were used to author this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant