Skip to content

Commit 61991b5

Browse files
authored
Add switch to disable apphost pack restore
Contributes to dotnet/runtime#58109 In dotnet/runtime we live build targeting packs, runtime packs and app host packs. For the former two, switches already exist to disable nuget restore: - EnableTargetingPackDownload - EnableRuntimePackDownload The latter one doesn't yet have such a switch and therefore is always restored by NuGet. In the cases where want to use the live built apphost pack, restore fails, i.e. from a runtime build: `artifacts/bin/trimmingTests/projects/Microsoft.Extensions.DependencyInjection.TrimmingTests/ActivatorUtilitiesTests/osx-x64/project.csproj(0,0): error NU1102: (NETCORE_ENGINEERING_TELEMETRY=Build) Unable to find package Microsoft.NETCore.App.Host.osx-x64 with version (= 8.0.0)`
1 parent ac8b0e8 commit 61991b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Copyright (c) .NET Foundation. All rights reserved.
146146
DotNetIjwHostLibraryNameWithoutExtension="$(_DotNetIjwHostLibraryNameWithoutExtension)"
147147
RuntimeGraphPath="$(BundledRuntimeIdentifierGraphFile)"
148148
KnownAppHostPacks="@(KnownAppHostPack)"
149-
NuGetRestoreSupported="$(_NuGetRestoreSupported)"
149+
NuGetRestoreSupported="$([MSBuild]::ValueOrDefault('$(EnableAppHostPackDownload)', '$(_NuGetRestoreSupported)'))"
150150
NetCoreTargetingPackRoot="$(NetCoreTargetingPackRoot)">
151151

152152
<Output TaskParameter="PackagesToDownload" ItemName="_PackageToDownload" />

0 commit comments

Comments
 (0)