File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 176176 <DebugType >portable</DebugType >
177177 </PropertyGroup >
178178
179+ <!-- Define properties for Framework dependent deployments in Packages
180+ https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#apphostdotnetsearch
181+ For FxDependent, we want to search for the apphost in the Environment or global location,
182+ as this was not causing any issues.
183+ For FxDependentDeployment, we want to search ONLY in global location.
184+ For SelfContained, we want to search in the app local location.
185+ -->
186+ <PropertyGroup Condition =" '$(AppDeployment)' == 'FxDependent' " >
187+ <!-- Specify both to keep existing behavior because we have not had complaints about this scenario -->
188+ <AppHostDotNetSearch >EnvironmentVariable;Global</AppHostDotNetSearch >
189+ </PropertyGroup >
190+
191+ <PropertyGroup Condition =" '$(AppDeployment)' == 'FxDependentDeployment' " >
192+ <!-- If we specify Environment too, it searches that first, no matter what order we specify-->
193+ <AppHostDotNetSearch >Global</AppHostDotNetSearch >
194+ </PropertyGroup >
195+
196+ <PropertyGroup Condition =" '$(AppDeployment)' == 'SelfContained' " >
197+ <AppHostDotNetSearch >AppLocal</AppHostDotNetSearch >
198+ </PropertyGroup >
199+
179200 <!-- Define all OS, release configuration properties -->
180201 <PropertyGroup Condition =" '$(Configuration)' == 'Release' " >
181202 <PublishReadyToRun >true</PublishReadyToRun >
Original file line number Diff line number Diff line change @@ -492,13 +492,24 @@ Fix steps:
492492 $Arguments += " /property:IsWindows=false"
493493 }
494494
495- # Framework Dependent builds do not support ReadyToRun as it needs a specific runtime to optimize for.
496- # The property is set in Powershell.Common.props file.
497- # We override the property through the build command line.
498- if (($Options.Runtime -like ' fxdependent*' -or $ForMinimalSize ) -and $Options.Runtime -notmatch $optimizedFddRegex ) {
499- $Arguments += " /property:PublishReadyToRun=false"
495+ # We pass in the AppDeployment property to indicate which type of deployment we are doing.
496+ # This allows the PowerShell.Common.props to set the correct properties for the build.
497+ $AppDeployment = if (($Options.Runtime -like ' fxdependent*' -or $ForMinimalSize ) -and $Options.Runtime -notmatch $optimizedFddRegex ) {
498+ # Global and zip files
499+ " FxDependent"
500+ }
501+ elseif ($Options.Runtime -like ' fxdependent*' -and $Options.Runtime -match $optimizedFddRegex ) {
502+ # These are Optimized and must come from the correct version of the runtime.
503+ # Global
504+ " FxDependentDeployment"
505+ }
506+ else {
507+ # The majority of our packages
508+ # AppLocal
509+ " SelfContained"
500510 }
501511
512+ $Arguments += " /property:AppDeployment=$AppDeployment "
502513 $Arguments += " --configuration" , $Options.Configuration
503514 $Arguments += " --framework" , $Options.Framework
504515
You can’t perform that action at this time.
0 commit comments