-
Notifications
You must be signed in to change notification settings - Fork 256
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
Nuget pack handles nuspec files containing wildcards wrong #7658
Comments
Floating versions are not valid in the nuspec. https://docs.microsoft.com/en-us/nuget/reference/nuspec#dependencies-element Through years of learning, NuGet basically says that the lowest version is the one that can help us get the best resolution graph. |
Closing per the above comment. |
@nkolev92 - "Floating versions are not valid in the nuspec." The following is under the "References in .nuspec files" near the bottom. <!-- Accepts any 6.x.y version. -->
<dependency id="ExamplePackage" version="6.*" /> I'd like to add my vote that this behaviour of taking the oldest available package version is about as clear as mud - I've not found any documentation that suggests that a .nuspec doesn't support the Wildcard notation. |
I have created a PR NuGet/docs.microsoft.com-nuget#1317 fixing the bad example. I have also created a follow up issue to clearly call out that this is the case. https://github.com/NuGet/docs.microsoft.com-nuget/issues/1318 Regarding the dependency resolution, you can read more about it here; https://docs.microsoft.com/en-us/nuget/consume-packages/dependency-resolution |
It would be great if the docs gets updated and more clear! Regarding the lowest version on dependency resolution. Our solution ended up that we wrote our own component that analyze the dependency in the nuspec-file and updated it accordingly with the highest (safe) version, its a step in our buildprocess. That works for our internal components were we own the versioning pattern(semver). The 3:rd party components gets updated manually in the developement cycle so that we dont risk getting the wrong version when the buildcycle runs. |
Thanks @nkolev92 - I'm fairly new to NuGet, so have spent quite a while looking through the documentation. It's great to hear that there will now be updates to clarify them for others. |
Details about Problem
We are using msbuild to paclk and publish a nuget from a nuspec file. In the nuspec file there is a dependency to another nuget-package whith a specified version as 1.0.* (included below). When we run the pack-step on the nuspec-file with nuget.exe, the nuspec-file that gets inserted in the package has changed the version on the dependant nuget-package to 1.0.0, which means that the dependent package dont get updated to the latest published version when we run Install-Package.
We use the new packageReference style instead of having a packages.config file.
Tool versions
NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe):
Msbuild.exe version : Toolsversion 15.0
NuGet version (4.9.2.5706):
dotnet.exe --version (if appropriate):
OS version (i.e. win10 v1607 (14393.321)):
Win10 v
Worked before? If so, with which NuGet version:
Detailed repro steps so we can see the same problem
Run nuget pack on nuspec file with a dependeny on another nuget-package whith a verison specified as 1.0.*
Check the created nuspec file included in the package created
Original nuspecfile
nuspec file after running nuget.exe pack
Verbose Logs
Project "BuildGRV.proj" (Nuget_Pack target(s)):
Exec: C:\Net\9860\App\Win\A9996ALRAMUtil\bin\Debug\BuildScripts\Util\NuGet.exe pack C:\Temp\Net\Build\s86522\9860\VO\GRV\Misc\ZOSUtil.nuspec -Verbosity detailed -BasePath C:\Temp\Net\Build\s86522\9860\VO\GRV\Misc
Exec: NuGet Version: 4.9.2.5706
Exec: Attempting to build package from 'ZOSUtil.nuspec'.
Exec:
Exec: Id: Alecta.VO.GRV.ZOSUtil
Exec: Version: 1.0.14
Exec: Authors: S86522
Exec: Description: Komponenter ommunikation mellan .net och CAGentter
Exec: Dependencies: Alecta.VO.GRV.Common [1.0.*, )
Exec:
Exec: Added file '[Content_Types].xml'.
Exec: Added file '_rels/.rels'.
Exec: Added file 'Alecta.VO.GRV.ZOSUtil.nuspec'.
Exec: Added file 'lib/net451/Alecta.VO.GRV.Common.ZOSUtil.dll'.
Exec: Added file 'lib/net451/CA.Gen.csu.dll'.
Exec: Added file 'lib/net451/CA.Gen.exits.dll'.
Exec: Added file 'lib/net451/CA.Gen.odc.dll'.
Exec: Added file 'lib/net451/CA.Gen.odc.msgcfb.dll'.
Exec: Added file 'lib/net451/CA.Gen.odc.tcpip.dll'.
Exec: Added file 'lib/net451/CA.Gen.vwrt.dll'.
Exec: Added file 'lib/net451/Pgafs003.interfaces.dll'.
Exec: Added file 'lib/net451/Pgafs003.proxy.dll'.
Exec: Added file 'package/services/metadata/core-properties/c4d68c82744e428bbf65ef7c9b54aabf.psmdcp'.
Exec:
Exec: Successfully created package 'C:\Temp\Net\Build\s86522\9860\VO\GRV\Nuget\Alecta.VO.GRV.ZOSUtil.1.0.14.nupkg'.
The text was updated successfully, but these errors were encountered: