Skip to content

Update .nuspec to require a min NuGet version #836

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

Merged
merged 1 commit into from
Nov 3, 2014
Merged

Conversation

nulltoken
Copy link
Member

#821 improved the way the binaries are deployed on Windows through NuGet.

However, this requires a minimum NuGet version for this to work.

Maybe something like this (from #425) should do the trick

diff --git a/nuget.package/LibGit2Sharp.nuspec b/nuget.package/LibGit2Sharp.nuspec
index 3bacd54..77d637d 100644
--- a/nuget.package/LibGit2Sharp.nuspec
+++ b/nuget.package/LibGit2Sharp.nuspec
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
-  <metadata>
+<package xmlns="http://schemas.microsoft.com/packaging/2013/01/nuspec.xsd">
+  <metadata minClientVersion="2.7">
     <id>$id$</id>
     <version>$version$</version>

@nulltoken
Copy link
Member Author

/cc @sharwell

@nulltoken
Copy link
Member Author

FWIW NuGet usage per version can be found at https://www.nuget.org/stats

@sharwell
Copy link
Contributor

It's a toss-up here (IMO of course). The package will still be "usable" with lower versions of NuGet, but users will be responsible for copying the native binaries to the output directory themselves. Adding the minClientVersion attribute will prevent lower versions of NuGet from attempting to install the package at all.

@nulltoken
Copy link
Member Author

I see your point. However, from a user perspective, I'm not sure how "usable" it would be to get the package deployed and not being to use it immediatly. Moreover, we would have to explicitly document how to make the automatic copying of the binaries as part of the build process.

I think I'd rather err on the side of a fail fast and explicitly by making the package explicitly state NuGet 2.7+ is required (2.7 fixes a bug when it comes to .targets when restoring a package IIRC, however as we're only relying a .props file, maybe could we only require 2.5+?).

@sharwell
Copy link
Contributor

I'm in agreement with @nulltoken that the benefits of setting the minimum version to NuGet 2.7 outweighs the downsides.

@nulltoken
Copy link
Member Author

Transmuted into a Pull Request.

@nulltoken nulltoken merged commit a03f597 into vNext Nov 3, 2014
@Therzok Therzok deleted the ntk/min_nuget_27 branch November 3, 2014 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants