Nuget Versioning In Your Library

I was building up a library this morning, and I wanted to use Json.NET with it for deserializing. I was planning on using this library for a number of different apps, and it made me wonder, if I add a dependency such as Json.NET, will it cause problems if I am already consuming it in my app?

Nuget Versioning

For my library, version 10 or higher should be sufficient. I dug into the nuget docs and found a bunch of handy examples.

I installed 10.0.3 into my library project. In the project file itself, I changed the reference version from 10.0.3 to be just 10.0. According to the nuget docs, this will enable 10.0 to be the minimum version, and if there are higher versions, they will be accepted.

<Project Sdk="Microsoft.NET.Sdk">

    <Compile Include="a_class_file.cs" Link="a_class_file.cs" />

    <PackageReference Include="Newtonsoft.Json" Version="10.0" />

Other Versioning

Some other helpful items:

Notation Description
Version="[10.0,11.0]" includes anything from 10.0 to 11.0 including 10.0 and 11.0
Version="(,11.0]" Includes anything up to and including 11.0
Version="[11.0]" Only accept version 11.0

There are lots of other helpful examples in the documentation.

New Xamarin Docs

If you have been working with Xamarin for a while then you are probably familiar with the site and haven’t been there in a while, you are in for a treat. The docs have been migrated to the new Microsoft Documentation Platform.

The new platform is great. Pretty much every technology that you would want to work with is here. In this case we go to the Xamarin section and we have all the docs handy. Lets dive into the “Getting Started” document.



Inside each of the documents the page is divided into three columns. The left column is a table of contents for the current document and the right hand column contains indexes into the sections of the current page. The middle column has all the information.

doc page

One of my favorite features is at the very bottom of the left hand column. If you are traveling and are going to be offline for a while, there is a link there that will create an offline pdf file that you can download to your own computer. I use it every time I fly somewhere.

Also, if you feel like contributing, there is a link at the bottom to take you to the GitHub repo where you can submit issues with the documentation and even submit new articles and updates. If you are so interested, make sure to read the contribution guidelines first!