[release/v7.5] Specify .NET search by build type (#26408)

This commit is contained in:
Travis Plunk
2026-02-11 16:11:31 -08:00
committed by GitHub
parent 1b48948275
commit d92015e37c
2 changed files with 37 additions and 5 deletions
+21
View File
@@ -176,6 +176,27 @@
<DebugType>portable</DebugType>
</PropertyGroup>
<!-- 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,
as this was not causing any issues.
For FxDependentDeployment, we want to search ONLY in global location.
For SelfContained, we want to search in the app local location.
-->
<PropertyGroup Condition=" '$(AppDeployment)' == 'FxDependent' ">
<!-- Specify both to keep existing behavior because we have not had complaints about this scenario -->
<AppHostDotNetSearch>EnvironmentVariable;Global</AppHostDotNetSearch>
</PropertyGroup>
<PropertyGroup Condition=" '$(AppDeployment)' == 'FxDependentDeployment' ">
<!-- If we specify Environment too, it searches that first, no matter what order we specify-->
<AppHostDotNetSearch>Global</AppHostDotNetSearch>
</PropertyGroup>
<PropertyGroup Condition=" '$(AppDeployment)' == 'SelfContained' ">
<AppHostDotNetSearch>AppLocal</AppHostDotNetSearch>
</PropertyGroup>
<!-- Define all OS, release configuration properties -->
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<PublishReadyToRun>true</PublishReadyToRun>
+16 -5
View File
@@ -492,13 +492,24 @@ Fix steps:
$Arguments += "/property:IsWindows=false"
}
# Framework Dependent builds do not support ReadyToRun as it needs a specific runtime to optimize for.
# The property is set in Powershell.Common.props file.
# We override the property through the build command line.
if(($Options.Runtime -like 'fxdependent*' -or $ForMinimalSize) -and $Options.Runtime -notmatch $optimizedFddRegex) {
$Arguments += "/property:PublishReadyToRun=false"
# We pass in the AppDeployment property to indicate which type of deployment we are doing.
# This allows the PowerShell.Common.props to set the correct properties for the build.
$AppDeployment = if(($Options.Runtime -like 'fxdependent*' -or $ForMinimalSize) -and $Options.Runtime -notmatch $optimizedFddRegex) {
# Global and zip files
"FxDependent"
}
elseif($Options.Runtime -like 'fxdependent*' -and $Options.Runtime -match $optimizedFddRegex) {
# These are Optimized and must come from the correct version of the runtime.
# Global
"FxDependentDeployment"
}
else {
# The majority of our packages
# AppLocal
"SelfContained"
}
$Arguments += "/property:AppDeployment=$AppDeployment"
$Arguments += "--configuration", $Options.Configuration
$Arguments += "--framework", $Options.Framework