Skip to content

Accessing the private Nuget feeds #1853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
eginsjd opened this issue Nov 29, 2021 · 1 comment
Closed

Accessing the private Nuget feeds #1853

eginsjd opened this issue Nov 29, 2021 · 1 comment

Comments

@eginsjd
Copy link

eginsjd commented Nov 29, 2021

I'm trying to run BDN on a performance test project on Azure pipelines. My solution has a config file with two private sources, every time BenchmarkDotNet Runner is invoked I get dotnet restore 401 from the autogenerated script by BDN.
Is there a way to pass the authentication token or overwrite the Nuget config for BenchmarkDotNet?
I'm getting Nuget.Target(131, 5) error.

@adamsitnik
Copy link
Member

Is there a way to pass the authentication token

No unless it can be passed as an MsBuild argument (job.With(new Argument[] { new MsBuildArgument("/p:SomeProperty=Value")}). We don't plan to add it, but a contribution would be welcomed. This is where the dotnet restore command is built:

internal static string GetRestoreCommand(ArtifactsPaths artifactsPaths, BuildPartition buildPartition, string extraArguments = null)
=> new StringBuilder()
.Append("restore ")
.Append(string.IsNullOrEmpty(artifactsPaths.PackagesDirectoryName) ? string.Empty : $"--packages \"{artifactsPaths.PackagesDirectoryName}\" ")
.Append(GetCustomMsBuildArguments(buildPartition.RepresentativeBenchmarkCase, buildPartition.Resolver))
.Append(extraArguments)
.Append(GetMandatoryMsBuildSettings(buildPartition.BuildConfiguration))
.ToString();

You may also check if just ignoring the 401 error would help:

var restoreResult = Restore();
if (!restoreResult.IsSuccess)

overwrite the Nuget config for BenchmarkDotNet

BDN should respect the NuGet.config file stored in the root of your repo. I am not sure about the folder where project with benchmarks is defined.

I am closing the issue as it's a duplicate of #1358

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

No branches or pull requests

2 participants