C#C
C#4y ago
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.
Was this page helpful?