Fix devcontainer for private NuGet feed authentication and .NET 9.0 support #776
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The existing devcontainer configuration had two critical issues preventing proper project setup:
global.jsonEssentialCSharp.Shared.ModelsandContentFeedNugetpackagesThis resulted in developers being unable to restore packages or build the project within the devcontainer.
Solution
1. Updated DevContainer Configuration
Modified
.devcontainer/devcontainer.jsonto:global.jsonAZURE_DEVOPS_PATenvironment variable for private feed authentication2. Created Intelligent Setup Script
The new
.devcontainer/setup.shprovides:3. Enhanced Documentation
Updated
README.mdwith:Key Features
For developers with private feed access:
For developers without private feed access:
# Simply open in devcontainer -> automatic fallback to public packagesRobust error handling:
AccessToNugetFeed=falsewhen private feed is unavailableTesting
✅ Package restore works without private feed access
✅ Build and tests pass with .NET 9.0.101
✅ Authentication flow works with valid PAT tokens
✅ Graceful fallback when authentication fails
✅ Script is idempotent and handles re-runs correctly
The devcontainer now mirrors the GitHub Actions workflow authentication approach, ensuring consistent behavior between CI/CD and local development environments.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
api.hcaptcha.com/home/REDACTED/.dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/EssentialCSharp.Web/EssentialCSharp.Web/EssentialCSharp.Web.Tests/bin/Release/net9.0/EssentialCSharp.Web.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/EssentialCSharp.Web/EssentialCSharp.Web/EssentialCSharp.Web.Tests/bin/Release/net9.0/EssentialCSharp.Web.Tests.deps.json /home/REDACTED/work/EssentialCSharp.Web/EssentialCSharp.Web/EssentialCSharp.Web.Tests/bin/Release/net9.0/testhost.dll --port 46133 --endpoint 127.0.0.1:046133 --role client --parentprocessid 4053 --telemetryoptedin false(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.