Fix package code for new NuGet.

The new NuGet uses tolower paths, and we need to react to it.

Port https://github.com/dotnet/cli/pull/2722
Port https://github.com/dotnet/cli/pull/3554
This commit is contained in:
Eric Erhardt 2016-07-26 13:20:23 -05:00
parent d54bba96cd
commit a48def9ade
19 changed files with 150 additions and 73 deletions

View file

@ -145,13 +145,16 @@ namespace Microsoft.DotNet.Tools.Run
}
List<string> hostArgs = new List<string>();
if (!_context.TargetFramework.IsDesktop())
if (!_context.TargetFramework.IsDesktop() && _context.LockFile != null)
{
// Add Nuget Packages Probing Path
var nugetPackagesRoot = _context.PackagesDirectory;
var probingPathArg = "--additionalprobingpath";
hostArgs.Insert(0, nugetPackagesRoot);
hostArgs.Insert(0, probingPathArg);
// Add Nuget Packages Probing Paths
const string probingPathArg = "--additionalprobingpath";
foreach (var packageFolder in _context.LockFile.PackageFolders)
{
hostArgs.Insert(0, packageFolder.Path);
hostArgs.Insert(0, probingPathArg);
}
}
// Now launch the output and give it the results