How to require min version of NuGet in a package?

Topics: General
Jul 5, 2012 at 10:54 PM

Say I have a package that relies on the very cool new per-target-framework-content files. 

If someone with a pre-2.0 version of nuget tries to install my package, I want it to fail and tell them they need the new one.

 

Is there already a way to do that automatically? Or should I write a bit of PS?

Jul 5, 2012 at 10:59 PM

You don't need to do anything. NuGet already takes care of that for you. When you use nuget.exe pack command or NPE to create your package, we stamp it with the new xml schema version (in the .nuspec file), which prevents older nuget client from installing it.

Jul 5, 2012 at 11:04 PM
what's the schema version to use now then?

/kzu

--
Daniel Cazzulino | Developer Lead | Clarius Consulting | +1 425.2004.kzu (598)


On Thu, Jul 5, 2012 at 6:59 PM, dotnetjunky <notifications@codeplex.com> wrote:

From: dotnetjunky

You don't need to do anything. NuGet already takes care of that for you. When you use nuget.exe pack command or NPE to create your package, we stamp it with the new xml schema version (in the .nuspec file), which prevents older nuget client from installing it.

Read the full discussion online.

To add a post to this discussion, reply to this email (nuget@discussions.codeplex.com)

To start a new discussion for this project, email nuget@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Jul 5, 2012 at 11:06 PM

You don't need to set the schema version yourself. The tools do it under the hood.

Jul 5, 2012 at 11:26 PM
I already have a lot of manually created .nuspecs ;)

/kzu

--
Daniel Cazzulino | Developer Lead | Clarius Consulting | +1 425.2004.kzu (598)


On Thu, Jul 5, 2012 at 7:07 PM, dotnetjunky <notifications@codeplex.com> wrote:

From: dotnetjunky

You don't need to set the schema version yourself. The tools do it under the hood.

Read the full discussion online.

To add a post to this discussion, reply to this email (nuget@discussions.codeplex.com)

To start a new discussion for this project, email nuget@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Jul 5, 2012 at 11:34 PM

Are you using nuget.exe pack command to create packages out of those .nuspec files? If so, nuget.exe will replace your .nuspec with the new one with the new schema version.

Anyhow, if you insist in knowing the new schema version, it is: http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd

Jul 6, 2012 at 1:39 AM

Isn't the automatic upgrade a known bug? I have a ticket out there for not being able to push a package built with nuget.exe v2 to an older version of the gallery.

Jul 6, 2012 at 1:49 AM

I felt the auto update thing was very weird. I usually want to control when and how files change, especially ones I created manually...

/kzu from mobile

On Jul 5, 2012 9:39 PM, "ferventcoder" <notifications@codeplex.com> wrote:

From: ferventcoder

Isn't the automatic upgrade a known bug? I have a ticket out there for not being able to push a package built with nuget.exe v2 to an older version of the gallery.

Read the full discussion online.

To add a post to this discussion, reply to this email (nuget@discussions.codeplex.com)

To start a new discussion for this project, email nuget@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com

Jul 6, 2012 at 1:51 AM

Found it - http://nuget.codeplex.com/workitem/2397

Jul 6, 2012 at 2:59 AM

The nuget.exe doesn't always auto-update the schema version. It is smart enough to detect if your package makes use of the new target-framework features in 2.0 before stamping the new schema version. If your package doesn't, then it will try to be as backwards-compatible as possible.

Jul 6, 2012 at 3:40 AM

So you fixed it then? Because the bug I have out it always updates.

On Jul 5, 2012 8:59 PM, "dotnetjunky" <notifications@codeplex.com> wrote:

From: dotnetjunky

The nuget.exe doesn't always auto-update the schema version. It is smart enough to detect if your package makes use of the new target-framework features in 2.0 before stamping the new schema version. If your package doesn't, then it will try to be as backwards-compatible as possible.

Read the full discussion online.

To add a post to this discussion, reply to this email (nuget@discussions.codeplex.com)

To start a new discussion for this project, email nuget@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com