Skip to content

Commit f5f0498

Browse files
Fix: Different startup steps implementation since other fix fails to restore (#622)
## Description Pull Request #601 implementation fails to restore. I believe I narrowed the problem down to the added `disabledPackageSources` property in nuget.config, though my access to the Nuget feed isn't currently working. This solution takes the disabling effect out of nuget.config and puts it in the Directory.Packages.props. In the .props file it conditionally restores the private Nuget feed based on the single bool prop, `AccessToNugetFeed`, defined in Directory.Build.props. Credit: [GitHub issue 1](NuGet/Home#6045), [GitHub issue 2](NuGet/Home#3972) --------- Co-authored-by: Benjamin Michaelis <[email protected]>
1 parent d8068eb commit f5f0498

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Directory.Build.props

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
<PreserveCompilationContext>true</PreserveCompilationContext>
88
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
99
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
10-
<AccessToNugetFeed>true</AccessToNugetFeed>
1110

1211
<!-- https://aka.ms/vs-build-acceleration -->
1312
<AccelerateBuildsInVisualStudio>True</AccelerateBuildsInVisualStudio>
1413
<UserSecretsId>18e91e0d-ea2d-490f-b77e-ec008f9d09ec</UserSecretsId>
1514
</PropertyGroup>
16-
</Project>
15+
</Project>

Directory.Packages.props

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
55
<ToolingPackagesVersion>1.1.1.4415</ToolingPackagesVersion>
6+
<AccessToNugetFeed>true</AccessToNugetFeed>
7+
<RestoreSources>
8+
https://api.nuget.org/v3/index.json;
9+
</RestoreSources>
10+
<RestoreSources Condition="$(AccessToNugetFeed)">
11+
$(RestoreSources);
12+
https://pkgs.dev.azure.com/intelliTect/_packaging/EssentialCSharp/nuget/v3/index.json;
13+
</RestoreSources>
614
</PropertyGroup>
715
<ItemGroup Condition="$(AccessToNugetFeed)">
816
<PackageVersion Include="ContentFeedNuget" Version="$(ToolingPackagesVersion)" />

0 commit comments

Comments
 (0)