Skip to content

Issue restoring nuget packages from private feeds that require credentials #788

@vidaj

Description

@vidaj

We are using private nuget feeds that require authentication.

To avoid including credentials in the source repository, we make use of the NuGet.config hierarchy to add the credentials to the machine-level Nuget.config file and not the repository-level NuGet.config file.

dotnet-script searches for the nearest NuGet.config file and automatically adds "--configfile" when restoring the script project.

When running "dotnet restore" with "--configfile", that eliminates the NuGet.config hierarchy and nuget will only read from the specified file.
From the documentation of "dotnet restore":

--configfile

The NuGet configuration file (nuget.config) to use. If specified, only the settings from this file will be used. If not specified, the hierarchy of configuration files from the current directory will be used.

My suggestion for a fix is the following:

Change the default behaviour to not use "--configfile" but instead copy the NuGet.config file to the temporary build area. This will have the same effect as passing the file with "--configfile", only that the NuGet.config hierarchy is restored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions