-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Enumerating package folders for .Net Core project #11773
Comments
@nkolev92 any chance you're able to answer this? |
The NuGet.g.props defines these in an MSBuild property, NuGetPackageFolders. For example looking in my NuGet.Client projects nuget.g.props, I see: <NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\nikolev\.nuget\packages\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder</NuGetPackageFolders> Does that help/answer the question? |
@nkolev92 Not quite - in our scenario, we're only able to parse the
For example, a potential answer might be "you shouldn't use In short, which does NuGet itself actually use to resolve the package location? |
I think you need to do the 1st one.
which in turn uses https://github.com/dotnet/sdk/blob/8288f55cf35fb642bf2838bd11b6e17d884f019f/src/Tasks/Microsoft.NET.Build.Tasks/NuGetPackageResolver.cs. The priority order that matter is global packages folder, then fallback folders. |
How are you reading the assets file btw? |
Thank you @nkolev92. We use standard Ruby JSON parser to read it after restoring the projects with |
If you were to look at the package folders on disk, you would typically be looking at all the packages that had been restored for all projects on that machine, rather than just the packages that the current project is using. |
Hi
I need to enumerate all package folders for a project basing on the
project.assets.json
file. The purpose is to extract licensing information about all project dependencies.I couldn't find schema definition for that file but looking at the typical contents there seems to be two options. Could you help me understanding which of them is the preferred one:
project->restore->packagesPath
property and combine it withproject->restore->fallbackFolder
packageFolders
propertyThank you,
Pavel
The text was updated successfully, but these errors were encountered: