Details
Description
Nuspec defines an optional targetFramework attribute as of version 2.0
When uploading a nupkg with a nuspec containing this attribute, Nexus does not expose the framework bits in the feed <p:dependencies> element, therefore installing these artifacts from a local nuget repo using visual studio does not work.
In contrast, downloading a nupkg from a _proxy_ repository feed WILL work because these dependency details include targetFramework details.
Example:
1) Download a nupkg which specifies dependencies with targetFramework
https://www.nuget.org/api/v2/package/Microsoft.AspNet.WebApi.Client/5.0.0
Results in a file called microsoft.aspnet.webapi.client.5.0.0.nupkg
1) Boot nexus Pro
2) Add a local repo of Nuget type
3) Using the artifact upload tab, upload the nuget artifact into the local nuget repo.
4) Perform a search against that local nuget repo for the uploaded artifact. The feed entry returned will not contain the targetFramework string inside the dependency element.
<d:Dependencies>Newtonsoft.Json:4.5.11|Newtonsoft.Json:4.5.11|Microsoft.Net.Http:2.2.13</d:Dependencies>
Compare this with a proxy Nuget repo of the official feed:
1) in nexus, add a proxy repo against https://www.nuget.org/api/v2
2) wait for the download nuget index task to complete ( approx 5-6 minutes )
3) Perform a search against that proxy nuget repo for the same artifact. The feed entry returned will contain the targetFramework string inside the dependency element.
<d:Dependencies>Newtonsoft.Json:4.5.11:net45|Newtonsoft.Json:4.5.11:portable-wp80+win+net45|Microsoft.Net.Http:2.2.13:portable-wp80+win+net45</d:Dependencies>
Attached files contain the detailed differences:
curl -v "http://localhost:8081/nexus/service/local/nuget/nuget-local/Search%28%29?\$filter=IsLatestVersion&\$skip=0&\$top=30&searchTerm=%27microsoft.aspnet.webapi.client%27&targetFramework=%27net45%27&includePrerelease=false" -o nexus-local.xml -u admin:admin123
curl -v "http://localhost:8081/nexus/service/local/nuget/nuget.org/Search%28%29?\$filter=IsLatestVersion&\$skip=0&\$top=30&searchTerm=%27microsoft.aspnet.webapi.client%27&targetFramework=%27net45%27&includePrerelease=false" -o nexus-proxy.xml -u admin:admin123
curl -v "https://www.nuget.org/api/v2/Search%28%29?\$filter=IsLatestVersion&\$skip=0&\$top=30&searchTerm=%27microsoft.aspnet.webapi.client%27&targetFramework=%27net45%27&includePrerelease=false" -o nuget.org.xml
Attachments
Issue Links
- is related to
-
NEXUS-14839 Hosted nuget repository ignore the framework version, always returns the .NET Core Version
-
- Closed
-
- relates
-
NEXUS-6159 different metadata values in search results NuGet proxy repo compared to Nuget hosted repo
-
- Open
-
-
NEXUS-12484 targetFramework attribute in NuGet nuspec file is rendered as Unsupported
-
- Closed
-
-
NEXUS-9531 NuGet local repositories should support API Search() by targetFramework
-
- Open
-