© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
1 reply
no >> body

dotnet restore to ignore packages

I have several projects in my solution:
1. Web API
2. Worker service
3. Application layer
and many others

Web API and Wonder service have a reference to the application layer.
The application layer project contains dependencies from an external package source, which I use only with the Worker service.

Now I need to create a docker image for WebAPI, and to do that, I need to call 'dotnet restore' in my Dockerfile.

Is it possible to ignore packages from external package sources if I don't need them in the project I want to build? Because now, to build an image, I need to provide a key for the NuGet source, which I will not use with WebAPI.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Docker Dotnet restore
C#CC# / help
3y ago
❔ Docker: Dotnet restore just loading
C#CC# / help
3y ago
❔ Docker issues with dotnet restore
C#CC# / help
4y ago