Skip to content

Commit 348977d

Browse files
committed
Turning on diag for all commands causes significant issues in the test run and makes it hard to track down.
1 parent 6ecb683 commit 348977d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/Microsoft.NET.TestFramework/Commands/MSBuildCommand.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,17 @@ public override CommandResult Execute(IEnumerable<string> args)
133133
args = new[] { "/restore" }.Concat(args);
134134
}
135135

136-
args = args.Concat(new[] { "-v:diag" });
136+
var command = base.Execute(args);
137137

138-
return base.Execute(args);
138+
var error = command.StdErr.ToString();
139+
var output = command.StdOut.ToString();
140+
if ((!String.IsNullOrEmpty(error) && error.Contains("NU3003")) || (!String.IsNullOrEmpty(output) && output.Contains("NU3003")))
141+
{
142+
args = args.Concat(new[] { "-v:diag" });
143+
command = base.Execute(args);
144+
}
145+
146+
return command;
139147
}
140148

141149
public CommandResult ExecuteWithoutRestore(IEnumerable<string> args)

0 commit comments

Comments
 (0)