When I'm creating a NuGet package I always ask myself how many targets I should provide? And usually I create all possible from 4.0 to 4.6 with all versions in between.
But is this really necessary? I noticed that all assemblies have the same size and to verify that they target the right version I used the JustDecompile.
I'm not an IL expert so I don't know what to look at when I open an assembly with ILDasm. Should I still compile several different versions or does it make sense only if I use something specific to a higher .NET version like a string.IsNullOrWhitespace etc.?
No, target the lowest version you need. If will work fine on higher versions. Most Nuget packages target 4.0. Some require 4.5 because they took a dependency on async or http. There are ways to make your life very complicated by taking that dependency and still support XP. Don't. Only other consideration is whether you want to make it a PCL class library so it can run on other platforms. Meh, later.
– Hans Passant