private void AddDlls(DirectoryInfo libRoot, List<string> result, LocalFileSystemDirectory localRoot, NugetLibraryProfile maxProfile)
{
var lib45 = GetChild(libRoot, "net45-full") ??
GetChild(libRoot, "net45");
var lib40 = GetChild(libRoot, "net40-full") ??
GetChild(libRoot, "net40") ??
GetChild(libRoot, "net4");
var lib40client = GetChild(libRoot, "net40-client");
var lib35 = GetChild(libRoot, "net35");
var lib35client = GetChild(libRoot, "net35-client");
var lib20 = GetChild(libRoot, "net20") ??
GetChild(libRoot, "20");
if (lib45 != null && maxProfile == NugetLibraryProfile.Net45)
result.AddRange(GetDllsIn(localRoot, lib45));
else if (lib40 != null && maxProfile >= NugetLibraryProfile.Net4)
result.AddRange(GetDllsIn(localRoot, lib40));
else if (lib40client != null && maxProfile >= NugetLibraryProfile.Net4Client)
result.AddRange(GetDllsIn(localRoot, lib40client));
else if (lib35 != null && maxProfile != NugetLibraryProfile.Net35)
result.AddRange(GetDllsIn(localRoot, lib35));
else if (lib35client != null && maxProfile != NugetLibraryProfile.Net35Client)
result.AddRange(GetDllsIn(localRoot, lib35client));
else if (lib20 != null && maxProfile != NugetLibraryProfile.Net2)
result.AddRange(GetDllsIn(localRoot, lib20));
else
result.AddRange(GetDllsIn(localRoot, libRoot));
}