question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is your feature request related to a problem? Please describe.

When I want to mirror two or more nuget servers, I can’t configure this. Otherwise I get:

Unhandled exception. System.FormatException: A duplicate key 'Mirror:Enabled' was found.
   at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.VisitValue(JsonElement value)
   at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.VisitElement(JsonElement element)
   at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.VisitValue(JsonElement value)
   at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.VisitElement(JsonElement element)
   at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.ParseStream(Stream input)
   at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream stream)
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.HandleException(ExceptionDispatchInfo info)
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load()
   at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
   at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
   at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at BaGet.Program.<>c__DisplayClass0_0.<<Main>b__1>d.MoveNext() in D:\a\1\s\src\BaGet\Program.cs:line 45
--- End of stack trace from previous location where exception was thrown ---
   at McMaster.Extensions.CommandLineUtils.CommandLineApplicationExtensions.<>c__DisplayClass9_0.<<OnExecuteAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
   at BaGet.Program.Main(String[] args) in D:\a\1\s\src\BaGet\Program.cs:line 51
   at BaGet.Program.<Main>(String[] args)

When I try it with a configuration like this:

  "Mirror": {
    "Enabled": true,
    "PackageSource": "https://api.nuget.org/v3/index.json"
  },

  "Mirror": {
    "Enabled": true,
    "PackageSource": "https://www.myget.org/F/caliburn-micro-builds/api/v3/index.json"
  },  

Describe the solution you’d like

It would be nice if we could have more than one mirror. The mirroring should be like this. If you don’t find it on the first mirror try the next one (like a chain). This allows to add specific alternatives that may have already newer packages (e.g. like myget in this case).

Describe alternatives you’ve considered

I could add multiple URLs to the project itself (nuget.config) but it would be nice if we could serve this by a single BaGet.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:9
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
jorgensigvardssoncommented, Oct 19, 2022

Would a PR for multiple mirrors be of interest? Ping @loic-sharma

1reaction
loic-sharmacommented, Sep 9, 2021

Yup you can always use multiple BaGet instances to support multiple mirrors (though that’s a bit of a hassle).

A problem with this feature is that it would make BaGet users vulnerable to package dependency confusion attacks. We would likely want to take inspiration from NuGet’s upcoming package namespaces feature.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multi / Wall-Mounted Mirrors / Mirrors
Online shopping from a great selection at Home & Kitchen Store.
Read more >
17 Multi Mirroring ideas | multiple mirrors, design, mirror wall
Jul 29, 2013 - A look at all the different and innovative ways to design with multiple mirrors. See more ideas about multiple...
Read more >
Is it okay to have more than one mirror in a room?
Great design or style faux pas? We asked the experts for their thoughts on multiple mirrors – and how to use them to...
Read more >
Multiple Mirrors
Jan 29, 2014 - Explore Susan Bobin's board "Multiple Mirrors" on Pinterest. See more ideas about multiple mirrors, home decor, house interior.
Read more >
How Many Mirrors Should You Use In Your Home?
Yes, you can hang multiple mirrors on a wall but it is essential you do so with safety and lighting in mind. Hanging...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found