-
Notifications
You must be signed in to change notification settings - Fork 8.2k
[release/v7.5] Specify .NET Search by Build Type #26408
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
base: release/v7.5
Are you sure you want to change the base?
[release/v7.5] Specify .NET Search by Build Type #26408
Conversation
Co-authored-by: Travis Plunk (HE/HIM) <[email protected]> Co-authored-by: Travis Plunk <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the build system to use a centralized AppDeployment property to control deployment-specific settings, replacing the previous approach of directly overriding PublishReadyToRun in the build script. The change moves the responsibility of setting deployment-specific MSBuild properties (like AppHostDotNetSearch) from build.psm1 to PowerShell.Common.props.
- Introduces
AppDeploymentproperty with three values:FxDependent,FxDependentDeployment, andSelfContained - Replaces direct
PublishReadyToRunoverride with conditional logic based onAppDeploymenttype - Adds
AppHostDotNetSearchconfiguration in PowerShell.Common.props for different deployment scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| build.psm1 | Replaces direct PublishReadyToRun property override with AppDeployment property that gets passed to MSBuild, determining deployment type based on runtime and ForMinimalSize flag |
| PowerShell.Common.props | Adds three PropertyGroup sections that configure AppHostDotNetSearch based on AppDeployment value, controlling where the .NET runtime searches for the apphost |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup Condition=" '$(AppDeployment)' == 'FxDependentDeployment' "> | ||
| <!-- If we specify Environment too, it searches that first, no matter what order we specify--> |
Copilot
AI
Nov 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment uses 'Environment' as shorthand for 'EnvironmentVariable'. For consistency with line 188 which uses the full property name 'EnvironmentVariable', the comment should use 'EnvironmentVariable' instead of 'Environment'.
| <!-- If we specify Environment too, it searches that first, no matter what order we specify--> | |
| <!-- If we specify EnvironmentVariable too, it searches that first, no matter what order we specify--> |
|
|
||
| <!-- Define properties for Framework dependent deployments in Packages | ||
| https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#apphostdotnetsearch | ||
| For FxDependent, we want to search for the apphost in the Environment or global location, |
Copilot
AI
Nov 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment uses 'Environment' as shorthand but line 188 sets the actual property value to 'EnvironmentVariable'. For clarity and consistency, the comment should use 'EnvironmentVariable' to match the actual property value.
| For FxDependent, we want to search for the apphost in the Environment or global location, | |
| For FxDependent, we want to search for the apphost in the EnvironmentVariable or global location, |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
Backport of #25837 to release/v7.5
Triggered by @TravisEz13 on behalf of @jshigetomi
Original CL Label: CL-BuildPackaging
/cc @PowerShell/powershell-maintainers
Impact
Tooling Impact
This backports build system improvements that specify .NET search behavior by build type (FxDependent, FxDependentDeployment, SelfContained). This is a prerequisite for PR #26290 which enables ready-to-run compilation only for Release configuration.
Regression
This is a build infrastructure improvement that adds more granular control over AppHostDotNetSearch and PublishReadyToRun settings based on deployment type.
Testing
Verified by:
This change enables proper deployment-specific configuration for framework-dependent and self-contained builds.
Risk
Medium risk: Changes build configuration properties that affect how PowerShell binaries are packaged and deployed. However, this is necessary infrastructure for enabling ready-to-run improvements (PR #26290) and has been validated in the main branch. The changes provide more explicit control over build behavior rather than changing existing functionality.