-
Notifications
You must be signed in to change notification settings - Fork 258
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
Support -ExcludeVersion for Restore and Update commands #1286
Comments
This doesn't make sense for the restore command (in package.config), but it could be interesting for the update command. |
@yishaigalatzer, would you mind elucidating why? How can I perform something like this:
and get my packages restored without version? |
I see what you mean now, you want to be able to "download" packages defined in packages.config without a version, so commands and paths just work without knowing the package version? |
Exactly, let us suppose that my package.config looks like
and the directory structure is similar to
and I want to have paths like ...ConsoleApplication1\packages\Newtonsoft.Json\lib instead of ConsoleApplication1\packages\Newtonsoft.Json.7.0.1. Nor do I want to write a huge nuget.targets file for msbuild with overridings of RestoreCommand variable. |
When we do support it you will not be able to
|
that's not a big deal for my project, this would not happen, "I'm feeling lucky":). The cruel problem that I have is that I have to commit and merge huge distracting csproj diffs in git instead of making a single change in packages.config.
looks ok to me as well |
You can start looking at using project.json (if your project is not asp.net 4), it resolves the issues you describe above (see how nuget.client repo is built for reference) |
also @maksim-dell one thing I just realized you can use install and restore interchangeably, so the main ask here is to support update on command line (and perhaps in vs?) |
Nuget 2.8 supported -ExcludeVersion when installing packages from package.config file. The documentation does not indicate that -ExcludeVersion is not longer supported in Nuget 3.2 when installing from package.config file. These commands behave correctly and install the package without using version number:
This no longer works as expected without any warning:
I find it strange this functionality was removed. |
That's a bug, not intentional |
this feature will be interesting.. we need to have more options to work in CI without messing with csproj |
@rmharinho take a look at this blog https://oren.codes/2016/02/08/project-json-all-the-things/ |
How will that help me? I m not even using project.json. |
If you move to use project.json these issues go away. |
Yeah but project.json is going to die so.... and i m running xplat sln with Xamarin and UWP and all that stuff.. Xamarin.Forms |
I hacked around i manually set the references to the folder of the nuget without version, then i can install a version with -ExcludeVersion on the folder and it will just work without messing with csproj's .. Our use case is running in teamcity, generate new Nuget's and install them in a sample project to run unit tests and uitest. |
It is not going to die as a package source (the uwp model, not the aspnet core model). There is a change but will be in how it's formatted rather than how it works. So the pattern is right. I don't know about when xamarin studio will support it, that's something valid to follow up on. |
Missed your last comment. I'd be happy to get on a call with you and help out for your exact scenario. Email me at support@nuget.org |
@KorsG
Hi,
Would it be possible to implement the -ExcludeVersion option for Restore and Update commands, just like the Install command ?
The text was updated successfully, but these errors were encountered: