-
Notifications
You must be signed in to change notification settings - Fork 162
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
Specify package source as cli argument #928
Comments
Indeed - this is needed! |
We honor what is provided in the NuGet.config. Is there a reason that is not sufficient? |
our internal feed is specified both in %appdata%\NuGet\NuGet.Config and in C:\Program Files (x86)\NuGet\Config\NuGet.Config. Upgrade-assistant still fetches from nuget.org. |
Oh interesting. We should be checking that so we should check on that |
Same here, this is really needed in a production development environment that is not fully connected to the internet for security reasons. |
@twsouthwick are you tracking the issue for connecting to Nuget feeds other than nuget.org despite them being provided nuget.config in another ticket? |
I'm seeing this too. In my environment we can't connect directly to nuget.org, but we have got an on-prem server that proxies through. I tried using a |
I think the way the tool finds your nuget config might have got broken in #824. See my comment: #824 (comment) EDIT: I've confirmed (by patching with dnSpy) that forcing |
I'm experiencing problems behind a proxy as well. |
@swythan Do you think you are able to create a pull request with your patch? (and tag this issue) |
Sorry I didn't patch it properly I just used dnSpy to inject a useful value for the project path at an opportune point. I just wanted to try it out first. I could see that it's not trivial to get the relevant bit of config where it needs to be since #824 (which is presumably why it got lost). As it turns out the tool wasn't useful for me in the end. I'd not realised that all the really useful capabilities are only really meant for going from .NET Framework to .NET (Core). I was looking for help upgrading between older versions of .NET Core/Standard to .NET 6. |
Specifically I used dnSpy to:
if (path == null)
{
path = Environment.CurrentDirectory;
}
Now run the tool with the current directory where your |
In my case we're pointing to internal repositories (we cannot restore packages from "api.nuget.org"). I've set the configuration in appsettings.json. I tried updating the "Source" parameter in appsettings.json. It is still picking up "https://api.nuget.org/v3/index.json". I also tried adding parameter --add-source. This command is not working. I don't understand why upgrade-assistant is not picking up the repositories defined in my global configuration for i.e %appdata%/NuGet/NuGet.config. I looked into the source code and found this method "NuGetPackageSourceFactory.GetPackageSources" is taking "PackageSourcePath" as parameter. To set "PackageSourcePath" explicitly I added the following configuration in appsetting.json Can somebody help me with this issue? |
Summary
Just as when installing the tool where you can supply a argument (--add-source) with a nuget feed, this is needed when running the upgrade aswell.
Motivation and goals
The analysis currently fails because it tries to fetch all packages from nuget.org, this feed is unavalible on our intranet.
Examples
dotnet has:
dotnet tool update -g upgrade-assistant --add-source proget/feed.json
upgrade-assiatnat should have:
upgrade-assistant analyze project.csproj --add-source proget/feed.json
The text was updated successfully, but these errors were encountered: