提交 bb9d9f3a 编写于 作者: S Sam Harwell

Clean up Build Boss code style and error messaging

上级 ba13751d
......@@ -21,13 +21,24 @@ public override string ToString()
{
var element = new XElement("InternalsVisibleTo");
if (TargetAssembly is object)
{
element.Add(new XAttribute("Include", TargetAssembly));
}
if (PublicKey is object)
{
element.Add(new XAttribute("Key", PublicKey));
}
if (LoadsWithinVisualStudio is object)
{
element.Add(new XAttribute("LoadsWithinVisualStudio", LoadsWithinVisualStudio));
}
if (WorkItem is object)
{
element.Add(new XAttribute("WorkItem", WorkItem));
}
return element.ToString();
}
......
......@@ -255,8 +255,14 @@ private bool CheckInternalsVisibleTo(TextWriter textWriter)
continue;
}
if (Uri.TryCreate(internalsVisibleTo.WorkItem, UriKind.Absolute, out _))
if (!string.IsNullOrEmpty(internalsVisibleTo.WorkItem))
{
if (!Uri.TryCreate(internalsVisibleTo.WorkItem, UriKind.Absolute, out _))
{
textWriter.WriteLine($"InternalsVisibleTo for external assembly '{internalsVisibleTo.TargetAssembly}' does not have a valid URI specified for {nameof(InternalsVisibleTo.WorkItem)}.");
allGood = false;
}
// A work item is tracking elimination of this IVT
continue;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册