Skip to content

Add NuGet.config to test projects to fix nuget restore under network isolation#1293

Merged
lbussell merged 2 commits intomainfrom
copilot/fix-nuget-restore-issue
Feb 11, 2026
Merged

Add NuGet.config to test projects to fix nuget restore under network isolation#1293
lbussell merged 2 commits intomainfrom
copilot/fix-nuget-restore-issue

Conversation

Copy link
Contributor

Copilot AI commented Feb 11, 2026

nuget restore in test container builds fails under 1ES Pipeline Template network isolation because there's no NuGet.config in the Docker build context — NuGet falls back to api.nuget.org which is blocked.

  • Added NuGet.config pointing to the Azure DevOps public feed (pkgs.dev.azure.com/dnceng/public/...) to all 8 test project directories that run nuget restore:
    • webapp-4.6.2, webapp-4.7, webapp-4.7.1, webapp-4.7.2, webapp-4.8, webapp-4.8.1
    • dotnetapp-4.8, dotnetapp-4.8.1

Each Dockerfile already does COPY . ./, so NuGet picks up the config automatically — no Dockerfile changes needed. Config content matches the repo root NuGet.config.

Original prompt

This section details on the original issue you should resolve

<issue_title>NuGet restore blocked by network isolation in VerifyImagesWithWebApps Test</issue_title>
<issue_description>Pipeline: dotnet-framework-docker-official microsoft/dotnet-framework-docker#2900408

The Test stage fails across all 4 OS variants with the same root cause: nuget restore inside the test container cannot reach api.nuget.org due to 1ES Pipeline Template network isolation.

Failed Jobs

Job OS Test
Windows1809_amd64 ltsc2019 VerifyImagesWithWebApps (4.8)
Windows2022_amd64 ltsc2022 VerifyImagesWithWebApps (4.8.1)
Windows2025_amd64 ltsc2025 VerifyImagesWithWebApps (4.8.1)
WindowsLtsc2016_amd64 ltsc2016 VerifyImagesWithWebApps (4.8)

Root Cause

The webapp-4.8 test project Dockerfile runs nuget restore at build time, but the Docker build context (tests/.../projects/webapp-4.8/) does not include a NuGet.config. The container falls back to the default NuGet configuration pointing to https://api.nuget.org/v3/index.json.

The repo root NuGet.config uses the Azure DevOps public feed (pkgs.dev.azure.com/dnceng/public/...), which would work under network isolation, but it is not available inside the test container's Docker build context.

Packages Affected

From tests/.../projects/webapp-4.8/packages.config:

  • Microsoft.Net.Compilers 2.6.1
  • Microsoft.CodeDom.Providers.DotNetCompilerPlatform 1.0.8

Suggested Fix

Copy or generate a NuGet.config into the webapp test project build context that uses the internal Azure DevOps feed (https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json) instead of relying on the default api.nuget.org source.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…isolation

The VerifyImagesWithWebApps tests fail because nuget restore inside test
containers cannot reach api.nuget.org due to 1ES Pipeline Template network
isolation. Added NuGet.config files pointing to the Azure DevOps public feed
to all test project directories that use nuget restore in their Dockerfiles.

Co-authored-by: lbussell <36081148+lbussell@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix NuGet restore block due to network isolation Add NuGet.config to test projects to fix nuget restore under network isolation Feb 11, 2026
Copilot AI requested a review from lbussell February 11, 2026 18:05
@lbussell lbussell marked this pull request as ready for review February 11, 2026 19:37
@lbussell lbussell requested a review from a team as a code owner February 11, 2026 19:37
@lbussell lbussell enabled auto-merge (squash) February 11, 2026 19:50
@lbussell lbussell merged commit 227180b into main Feb 11, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NuGet restore blocked by network isolation in VerifyImagesWithWebApps Test

3 participants

Comments