Please add an option to specify the NuGet "version" to include

97 views
Skip to first unread message

uwe....@gmail.com

unread,
Apr 10, 2015, 2:36:11 AM4/10/15
to cs-s...@googlegroups.com
In Visual Studio I can configure whether a NuGet package should be import "stable only" or "include pre-releases".

I would love to have such an option, too. Currently it seems that the css_nuget directive always includes the latest stable.

My suggestion is to add some kind of switch to the css_nuget directive like e.g.

// css_nuget MyPackage allow_prereleases

Maybe this is already possible?

Oleg Shilo

unread,
Apr 10, 2015, 3:33:53 AM4/10/15
to cs-s...@googlegroups.com
No it is not there :)

I will add it to the next release. The API will be as in the following samples:

//css_nuget -noref -ng:"-IncludePrerelease –version 1.0beta" cs-script
//css_nuget -ng:-IncludePrerelease cs-script
 
Cheers,
Oleg 

--
You received this message because you are subscribed to the Google Groups "CS-Script" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cs-script+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

uwe....@gmail.com

unread,
Apr 10, 2015, 3:43:41 AM4/10/15
to cs-s...@googlegroups.com, osh...@gmail.com
Awesome! Thanks a lot!

jth...@gmail.com

unread,
Nov 12, 2015, 3:55:42 PM11/12/15
to CS-Script, osh...@gmail.com
Can you give an example of specifying version in the docs?

I am trying this but it is grabbing the latest version of NLog:

//css_nuget Seq.Client.NLog
//css_nuget -ng:"–Version 3.1.0" NLog

-Jared

Oleg Shilo

unread,
Nov 12, 2015, 11:37:27 PM11/12/15
to CS-Script, osh...@gmail.com, jth...@gmail.com
Of course you can manage the referencing of the specific version -noref switch:

//css_nuget Seq.Client.NLog
//css_nuget -noref -ng:"–Version 3.1.0" NLog
//css_ref %css_nuget%\NLog\NLog.3.1.0\lib\net40\NLog.dll

However this will not trigger the download of that specific version if some of NLog versions is already downloaded. Thus you will need to clean your NuGet directory to force the download.

Considering all these difficulties I decided to implement a proper vesrsion handling. The latest pre-release on codeplex (https://csscriptsource.codeplex.com/releases/view/618423) implements support for  new switches -force and -ver:

Format:
//css_nuget [-noref] [-force] [-ver:<version>] [-ng:<nuget arguments>] package0...[,packageN];

Examples:
//css_nuget -force cs-script;
//css_nuget -ver:4.1.2 NLog
//css_nuget -ver:"4.1.1-rc1" -ng:"-Pre -NoCache" NLog

Can you please verify the fix before it goes fully official.

Thank you
Reply all
Reply to author
Forward
0 new messages