Pass no additional arguments to net451 app

This commit is contained in:
Pavel Krymets 2016-03-31 09:00:25 -07:00
parent 1428eb81cf
commit 7e73e5c379
4 changed files with 15 additions and 7 deletions

View file

@ -6,7 +6,7 @@ namespace ConsoleApplication
{
public static void Main(string[] args)
{
Console.WriteLine("NET451");
Console.WriteLine("NET451, ARGS: " + args.Length);
}
}
}

View file

@ -124,11 +124,14 @@ namespace Microsoft.DotNet.Tools.Run
return result;
}
if (!_context.TargetFramework.IsDesktop())
{
// Add Nuget Packages Probing Path
var nugetPackagesRoot = _context.PackagesDirectory;
var probingPathArg = "--additionalprobingpath";
_args.Insert(0, nugetPackagesRoot);
_args.Insert(0, probingPathArg);
}
// Now launch the output and give it the results
var outputPaths = _context.GetOutputPaths(Configuration);

View file

@ -78,6 +78,11 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
args = $"run {BuildArgs()} {args}";
return base.Execute(args);
}
public override CommandResult ExecuteWithCapturedOutput(string args = "")
{
args = $"run {BuildArgs()} {args}";
return base.ExecuteWithCapturedOutput(args);
}
private string BuildArgs()
{

View file

@ -20,7 +20,7 @@ namespace Microsoft.DotNet.Tools.Run.Tests
TestInstance instance = TestAssetsManager.CreateTestInstance(Path.Combine(RunTestsBase, "TestAppFullClr"))
.WithLockFiles()
.WithBuildArtifacts();
new RunCommand(instance.TestRoot).Execute().Should().Pass();
new RunCommand(instance.TestRoot).ExecuteWithCapturedOutput().Should().Pass().And.HaveStdOutContaining("NET451, ARGS: 0");
}
[Fact]