Support versioning of Nuget Packages
It would be great to have the ability to choose a version other than the latest version of a Nuget package. Oftentimes, we find that latest versions of packages can break functionality or we are just not ready to move to latest version of package yet and we are not in control of the Nuget package itself.
I would like to be able to add Nuget reference and optionally supply a specific version string (it can be manual entry and not a list).
NuGet versioning is now supported in the latest beta: www.linqpad.net/beta.aspx
James Ross commented
I just used a specific NuGet version using an attribute like Version="9.0.1" and it saved the day. I had no idea I could specify a version! Thanks!
To clarify: To use this feature, instead of clicking 'Add to query', click the arrow next to the button and choose 'Add specific version to query'.
Mackenzie Zastrow commented
I found this via decompiling (sorry, I couldn't find any documentation on specific versions of nuget packages).
If you look at the file format, you'll notice nuget packages are denoted like so:
You can add a "Version" attribute to the NuGetReference element:
You can also add Prerelease="True" if need be (I'm not sure if it's needed for pre-release packages).
Jason Hurdlow commented
There is no mention of this feature on the 'beta' page. Can you give us a valid link to the documentation for this feature? I need to enforce a specific major version of a package that I share with co-workers and there was a complete API break in the subsequent major version of the package I need.
This is no longer supported?
I often provide examples to my customers or fellow developers in the form of a linqpad script. However, there's been a few issues recently, especially with customers, where the referenced nuget package is out of date. It's too hard for me to explain to customers how to upgrade nuget packages, so I'm left with a customer with whom I can no longer send scripts to any more. I would like to be able to add a minimum version, or at the very least, a static version.
chilversc . commented
I need this when working with libraries that can have breaking changes between major versions while writing scripts for different applications that use different versions of the library. One example is connecting to mysql databases that are still using the pre-4.1 password format, where the latest connectors do not support pre-4.1 passwords.