-
Notifications
You must be signed in to change notification settings - Fork 252
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
[Feature Request] Disable caching for local/file system feeds #8251
Comments
It is possible to use fallback folders to get this behavior today. NuGet will search the global package folder, then the fallback folders. |
To configure FallbackPackageFolders via nuget.config:
We don't have this covered in documentation very well. We added the feature in NuGet 3.5, I believe...and I've opened a doc issue with some details: https://github.com/NuGet/docs.microsoft.com-nuget/issues/1487 |
I tried this
But now the behavior has changed I am referencing version 2.5.0-* in my directory.targets and my fallback folder has 2.5.0-preview.2.50, but nuget.org has 2.5.0-preview.2.6 with the previous approach 2.5.0-preview.2.50 was referenced during the build - now 2.5.0-preview.2.6 is used. I guess because nuget.org is used before the fallback folder. Can I make the nuget client look into the fallback folder first before the package sources? |
If you are using * in a version (2., 1.0.0-, etc...) -- a full restore will always check all package sources. |
But it seems the fallback folder is not checked if a matching version is found in the package sources. But the fallback folder has the more recent version in this case. I still think that what we really want is to be able to disable caching per package source. |
Isn't this the issue? Why not adding the build number to the package? |
Please consider re-opening this We use a local folder for development of nuget packages, this involves creating a package and building the consuming app referencing that package. If there are bugs or additional features we want to put in the same release, we have to clear the nuget caches, sometimes having to restart windows due to locks. Then we must restore all the packages again including those which are not local development but from nuget.org To help us out, we would like to be able to say "don't cache this package source" when it is from a local path. nuget.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="local" value="./nuget" disableCache="True" />
</packageSources>
</configuration>
Using a new version number is not what we want to do until the package is to be released. This would be opt in so no backwards compatibility issues. Many thanks |
Disabling cache for specific feeds would be very useful. We are fighting every day with exactly the same issues that @MrAntix described. |
+1 for the ability to disable the cache for certain feeds. Not only for not copying the package to the cache upon resolution but also for not resolving packages from the local cache. This would allow Project A to depend on a local copy of package X while Project B can use the remote and cache it without impacting Project A. Please consider adding this feature |
Oh I'm happy to see I'm not alone facing this problem! This should be a must-have feature, because - as all of you - I'm facing this same problem and fallback folder nor a build number suit's well when we are talking about LOCAL DEVELOPMENT. |
@rrelyea can you re-open this feature request? There are really good reasons to have this feature. I think that we all can agree that the best thing is to have a robust CI/CD that:
(It's not always exactly like this, but in general terms we can say that it's the norm) But when we talk about local development, things get a little confusing. I think the current state of NuGet forces us to do a lot of pointless pushes to the remote repository, just creating an incredible number of useless pre-release builds when we could just test those features directly from another project of ours on the local machine. That's my point. If you want to understand better why, follow my example:
... do you see how much time I wasted? POSSIBLE SOLUTION: Please note that:
MY CURRENT SOLUTION:
This is my opinion, yours is welcome. |
Sorry, I'm no longer working on NuGet |
I opened a new feature request here: #13918 adding more context. |
For our builds we are using a local nuget feed to get dependencies from.
This local feed gets updated for every build - the version number of the packages do not always change.
Since nuget prefers the local cache (.nuget) over the file system source - we need to clear that cache manually all the time to make this work.
It would be nice if caching could be disabled on a per feed basis (especially for local / file system based feeds).
This is for SDK style / package reference based projects.
Build script: https://github.com/IdentityServer/IdentityServer4/blob/master/build.ps1
The text was updated successfully, but these errors were encountered: