-
Notifications
You must be signed in to change notification settings - Fork 257
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
Reference latest version of nuget package using PackageReference msbuild tag #6640
Comments
The way NuGet floating versions are implemented, * will resolve to the latest stable version. I assume in your scenario you're asking for the latest prerelease? If that's the case, then this is a duplicate of #912 |
Well, then there must be a bug. When I use the wildcard in the version attribute and try to reference the Selenium.WebDriver package it falls back to version 2.2.0 (the oldest package version), the latest stable version is 3.10.0. Any ideas why this happens? Here's my csproj: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<None Remove="Resources\chromedriver.exe" />
<PackageReference Include="Selenium.Support" Version="*"/>
<PackageReference Include="Selenium.WebDriver" Version="*"/>
<PackageReference Include="TomSun.NetStandard.Extensions" Version="*" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\chromedriver.exe" />
</ItemGroup>
</Project>
|
I just attempted your repo and it resolves to 3.11.0 for me. My csproj
Snippet from my assets file:
What's the version of NuGet that you're using? I'm not aware of any bugs regarding the above in area. What are your sources? Can you please post the full log here. |
It's still possible to reproduce this using Xamarin Android, Xamarin iOS or UWP projects: set packagereference to *, clean everything (delete bin/obj). VS/NuGet fails to retrieve the latest packages. |
Can you provide a repro project? I just tried that in the UWP project and it resolved just fine (those same packages listed above). If you have a repro, please attack your assets file as well. |
Try Android/iOS projects - they definitely seem to fail. Make sure you do a clean, remove any packages folders etc, and then attempt to build. |
@nickrandolph |
@nkolev92
Can I somehow force an update of packages at the beginning of the build? Edit:
|
@TFTomSun NuGet caches part of the restore graph to avoid frequent network calls when using "*". Related: Potentially you could also be hitting the http cache (30 mins) during your restore runs. Opening the browse tab in the UI will defeat that http cache. You can also read the old design spec here |
@nkolev92 especially the http cache is a problem since i can't really force a restore via rebuild in vs. .. right? |
Yes, with MSBuild use Note that the VS experience is lacking and will likely change in the future (maybe an explicit option). |
@nkolev92 I have the same issue now with template installation and i didn't find anyway to force a restore of the template package. The template is installed via the: Edit: |
When you create a template there are no nuget artifacts in place, so I'm not completely sure about your scenario. Are the right sources configured in this scenario? |
@nkolev92 My scenario is. I am currently developing a little tool that i deploy together with an template. I make changes to the tool, push the template incl. the tool assemblies and want to install the template again. |
To clean the http cache you can use the locals command. https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-locals Where do you push the template again? Does it pick up the new template if you try installing it 30 minutes or more after pushing? |
thx. cleaning the http cache solved the issue |
NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe):
NuGet version (x.x.x.xxx):
4.5.0.4685
dotnet.exe --version (if appropriate):
VS version (if appropriate):
15.5.7
OS version (i.e. win10 v1607 (14393.321)):
Windows 10.0.16299 Build 16299
Worked before? If so, with which NuGet version:
Detailed repro steps so we can see the same problem
I would like to automatically reference the latest available nuget packages with csproj files using the new PackageReference tag.
I tried:
However none of the above lines work as expected:
Is there any way to force nuget to always take the latest available version of a nuget package?
The text was updated successfully, but these errors were encountered: