Skip to content

Commit 316356f

Browse files
authored
Gather test diag logging to track down nuget issue (#44455)
2 parents 905b1e3 + 348977d commit 316356f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

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

136-
return base.Execute(args);
136+
var command = base.Execute(args);
137+
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;
137147
}
138148

139149
public CommandResult ExecuteWithoutRestore(IEnumerable<string> args)

0 commit comments

Comments
 (0)