-
When I used VS IDE install a nuget package and enter the global nuget cache, its structure is like However, when I used command line like The unpack structure is like
Why the structure is different and can it be the same? The same structure could help us including anyone who faces the same situation in the future have a good user experience. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
@Perry004 Just want to add the Stackoverflow Post, where I describe why I need this. |
Beta Was this translation helpful? Give feedback.
-
The answer to "why" is because the folder layout you see when doing "nuget.exe install" was the only folder layout when NuGet was originally created. I think it was when However, customers use "nuget.exe install" in build scripts, so changing the layout would break their scripts if the layout changed between different nuget versions. Note that non-SDK style projects using packages.config (rather than PackageReference) still use the old "v2" folder layout for the solution packages folder. nuget.exe has The NuGet.Client repo creates a "bootstrap" project that downloads and extracts packages to a specific location, and it avoids target framework compatibility checks, just as Since the question doesn't explain the problem trying to be solved, I don't know what the best suggestion I can provide is, or if I should suggest upvoting an existing issue and closing this as a duplicate, or if we should open a new feature request. |
Beta Was this translation helpful? Give feedback.
-
@zivkan This was the useful info, I needed to solve my issue.
It seems like I was looking for this command
Instead of
As the Still untested, but on the first glance it looks promising I will try to explain why I am looking for this command at the first place to clear up the XY problem at hand. Everything I am about to explain runs locally, no build-server, git action or what not, just plain old Visual Studio. I have currently 3 solutions, 4 and 5 are in the making, all those solutions share a common solution. In the good old days where I didn't have multi-target projects, I just simply referenced the dlls directly. eg. Project A is targeting I of course could have edited the path to contain the desired target-framework, like the following. Prior to multi-target, my reference in Project B would look like this
Now I could have changed it to this
But I refused to do this manually and wanted "magic" to happen which picked the ideal target it self. At first I simply added the projects I was referencing into the solution as existing projects and than used project references instead of the old way to reference the dlls. This seemed to work at first but I was running into more and more problems each day eg.
So all in all a very unpleasant working environment. My next idea was to use the magic of NuGet to pick the right target-framework. So I enabled
Every branch/trunk would now ouput So I added the following, notice the
Which declares In a
Finally I could install the package into Project B from my local package source, after the install I have to manually change the version number to the information I have added in
Everything seemed to work nicely, for the first days at least. But there was 1 problem, atleast for now, that I still needed to solve. While building Project A the NuGet packages where re-created because of While testing we figured out we could delete the files from To not manually delete the files after each build, we added a I want to replace the cleaning to the actually unpacking of the NuGet package. So there were we are today, where I tried to unpack my package with
Which has the goal of "updating" the unpacked stuff everytime a build happens. Temporarly I tried to work with auto-incrementing the version number with each build so that NuGet can again make magic happen to always get the lastest version with the new source code from the latest build. So I changed my
But sadly this doesn't work at all. Every minute? - but the build would need to finish in the same minute Both those aren't ideal. To overcome this I thought about calling Imagine a solution with 50+ projects and I would hit rebuild soltution now Which I am currently asking here if that is possible: Hope I explained my XY Problem. |
Beta Was this translation helpful? Give feedback.
-
@zkat @zivkan I understand that my plee for help got moved to discusssion, but the request about |
Beta Was this translation helpful? Give feedback.
The answer to "why" is because the folder layout you see when doing "nuget.exe install" was the only folder layout when NuGet was originally created. I think it was when
PackageReference
was added, the global package folder layout was changed because for performance reasons, and the global packages folder is considered a location that NuGet "owns", so is acceptable to modify in incompatible ways. I wasn't in the team at the time, but I think I remember others telling me that some customers did find this impactful and complained about the change. But since this is a location that only Nuget is intended to use, it was considered acceptable, given the benefits it provided.However, customers…