Using a nuget.config file with a custom globalPackagesFolder, the metadata of the referenced nuget packages will not be resolved.
Example for such a nuget.config file:
<?xml version="1.0" encoding="utf-8"?>
<!-- Adds the relative path Extern/NugetPackageFeed to the package sources -->
<!-- this file is merged with the user nuget settings and the settings in the .nuget dir of the solution -->
<configuration>
<config>
<add key="globalPackagesFolder" value="C:\SharedNugetPackages" />
</config>
</configuration>
Proposed change: The NugetUtils class could be adapted:
- add new parameter
Microsoft.Sbom.Common.Config.IConfiguration configuration to the constructor
- resolve the correct folder with
customPackagePath = SettingsUtility.GetGlobalPackagesFolder(Settings.LoadDefaultSettings(this.configuration.BuildComponentPath.Value));
- use
customPackagePath as a fallback solution to resolve the nuspecLocation in method NugetUtils.GetMetadataLocation
Using a
nuget.configfile with a customglobalPackagesFolder, the metadata of the referenced nuget packages will not be resolved.Example for such a
nuget.configfile:Proposed change: The
NugetUtilsclass could be adapted:Microsoft.Sbom.Common.Config.IConfiguration configurationto the constructorcustomPackagePath = SettingsUtility.GetGlobalPackagesFolder(Settings.LoadDefaultSettings(this.configuration.BuildComponentPath.Value));customPackagePathas a fallback solution to resolve thenuspecLocationin methodNugetUtils.GetMetadataLocation