Merge pull request #2160 from dotnet/pakrym/no-arg-net451
Pass no additional arguments to net451 app in dotnet run
This commit is contained in:
commit
429eb93cd9
4 changed files with 15 additions and 7 deletions
|
@ -6,7 +6,7 @@ namespace ConsoleApplication
|
||||||
{
|
{
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
Console.WriteLine("NET451");
|
Console.WriteLine("NET451, ARGS: " + args.Length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,11 +124,14 @@ namespace Microsoft.DotNet.Tools.Run
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add Nuget Packages Probing Path
|
if (!_context.TargetFramework.IsDesktop())
|
||||||
var nugetPackagesRoot = _context.PackagesDirectory;
|
{
|
||||||
var probingPathArg = "--additionalprobingpath";
|
// Add Nuget Packages Probing Path
|
||||||
_args.Insert(0, nugetPackagesRoot);
|
var nugetPackagesRoot = _context.PackagesDirectory;
|
||||||
_args.Insert(0, probingPathArg);
|
var probingPathArg = "--additionalprobingpath";
|
||||||
|
_args.Insert(0, nugetPackagesRoot);
|
||||||
|
_args.Insert(0, probingPathArg);
|
||||||
|
}
|
||||||
|
|
||||||
// Now launch the output and give it the results
|
// Now launch the output and give it the results
|
||||||
var outputPaths = _context.GetOutputPaths(Configuration);
|
var outputPaths = _context.GetOutputPaths(Configuration);
|
||||||
|
|
|
@ -78,6 +78,11 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
||||||
args = $"run {BuildArgs()} {args}";
|
args = $"run {BuildArgs()} {args}";
|
||||||
return base.Execute(args);
|
return base.Execute(args);
|
||||||
}
|
}
|
||||||
|
public override CommandResult ExecuteWithCapturedOutput(string args = "")
|
||||||
|
{
|
||||||
|
args = $"run {BuildArgs()} {args}";
|
||||||
|
return base.ExecuteWithCapturedOutput(args);
|
||||||
|
}
|
||||||
|
|
||||||
private string BuildArgs()
|
private string BuildArgs()
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace Microsoft.DotNet.Tools.Run.Tests
|
||||||
TestInstance instance = TestAssetsManager.CreateTestInstance(Path.Combine(RunTestsBase, "TestAppFullClr"))
|
TestInstance instance = TestAssetsManager.CreateTestInstance(Path.Combine(RunTestsBase, "TestAppFullClr"))
|
||||||
.WithLockFiles()
|
.WithLockFiles()
|
||||||
.WithBuildArtifacts();
|
.WithBuildArtifacts();
|
||||||
new RunCommand(instance.TestRoot).Execute().Should().Pass();
|
new RunCommand(instance.TestRoot).ExecuteWithCapturedOutput().Should().Pass().And.HaveStdOutContaining("NET451, ARGS: 0");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
Loading…
Add table
Reference in a new issue