dotnet-outdated
dotnet-outdated copied to clipboard
Add the ability to specify sources
When using the tool with a project that has nuget dependencies from sources other than https://api.nuget.org
you get the following error:
Unhandled Exception: System.AggregateException: One or more errors occurred. (The remote server returned an error: (404) Not Found.) ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.WebRequest.<>c.<GetResponseAsync>b__68_2(IAsyncResult iar)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at DotNetOutdated.HttpNuGetClient.<GetResource>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at DotNetOutdated.NuGetClient.<GetPackageInfo>d__1.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at DotNetOutdated.Program.Main(String[] args)
This should either be handled and the package ignored, or ideally, allow multiple sources to be specified.
@airzy91 Yep, that's definitely something that would be cool to support! Would you be able to submit a PR to implement this feature?
I have created a PR to ignore missing packages. I will look into adding the ability to specify sources if I get chance.
To add a bit more to this; I have been looking into it and the problem is two fold; while adding the ability to query multiple repositories is relatively trivial, more effort is needed as the majority of private repositories are not yet implementing the V3 API.
It appears that there is currently little movement in implementing V3 API in NuGet.Server (https://github.com/NuGet/NuGetGallery/issues/5038, https://github.com/NuGet/NuGetGallery/issues/2844)
Therefore to implement multiple sources adequately V2 API support would need to be implemented also.
It should be easy enough to support V2 API with the NuGet.Protocol package. This has abstractions over V2 and V3 such that both can be supported with the same code. You get file system sources for free too.