Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/Common.globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ dotnet_diagnostic.SA1517.severity = none
dotnet_diagnostic.SA1518.severity = suggestion

# Braces should not be omitted from multi-line child statement
dotnet_diagnostic.SA1519.severity = suggestion
dotnet_diagnostic.SA1519.severity = warning

# Use braces consistently
dotnet_diagnostic.SA1520.severity = warning
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ public void ContextCachesExistenceChecksInConditions(EvaluationContext.SharingPo
project.GetPropertyValue("p").ShouldBe("val");
}
else
{
switch (policy)
{
case EvaluationContext.SharingPolicy.Shared:
Expand All @@ -802,6 +803,7 @@ public void ContextCachesExistenceChecksInConditions(EvaluationContext.SharingPo
default:
throw new ArgumentOutOfRangeException(nameof(policy), policy, null);
}
}
}
);
}
Expand Down
3 changes: 3 additions & 0 deletions src/Tasks/GenerateResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3291,8 +3291,11 @@ private static bool ContainsProperlyNamedResourcesFiles(Assembly a, bool mainAss
{
String postfix = mainAssembly ? ".resources" : a.GetName().CultureInfo.Name + ".resources";
foreach (String manifestResourceName in a.GetManifestResourceNames())
{
if (manifestResourceName.EndsWith(postfix, StringComparison.OrdinalIgnoreCase))
return true;
}

return false;
}
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/Tasks/ManifestUtil/ApplicationManifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,7 @@ private class AssemblyAttributeFlags
public AssemblyAttributeFlags(string path)
{
using (MetadataReader r = MetadataReader.Create(path))
{
if (r != null)
{
IsSigned = !String.IsNullOrEmpty(r.PublicKeyToken);
Expand All @@ -960,6 +961,7 @@ public AssemblyAttributeFlags(string path)
HasPrimaryInteropAssemblyAttribute = r.HasAssemblyAttribute("System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute");
HasImportedFromTypeLibAttribute = r.HasAssemblyAttribute("System.Runtime.InteropServices.ImportedFromTypeLibAttribute");
}
}
}
}
#endregion
Expand Down
3 changes: 3 additions & 0 deletions src/Tasks/ManifestUtil/SecurityUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,11 @@ private static SecurityElement XmlElementToSecurityElement(XmlElement xe)
foreach (XmlAttribute xa in xe.Attributes)
se.AddAttribute(xa.Name, xa.Value);
foreach (XmlNode xn in xe.ChildNodes)
{
if (xn.NodeType == XmlNodeType.Element)
se.AddChild(XmlElementToSecurityElement((XmlElement)xn));
}

return se;
}

Expand Down
9 changes: 9 additions & 0 deletions src/Tasks/ManifestUtil/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,13 @@ public static string FilterNonprintableChars(string value)
StringBuilder sb = new StringBuilder(value);
int i = 0;
while (i < sb.Length)
{
if (sb[i] < ' ')
sb.Remove(i, 1);
else
++i;
}

return sb.ToString();
}

Expand Down Expand Up @@ -337,8 +340,11 @@ internal static bool IsValidFrameworkVersion(string value)
public static string PlatformToProcessorArchitecture(string platform)
{
for (int i = 0; i < s_platforms.Length; ++i)
{
if (String.Equals(platform, s_platforms[i], StringComparison.OrdinalIgnoreCase))
return s_processorArchitectures[i];
}

return null;
}

Expand Down Expand Up @@ -403,6 +409,7 @@ public static void WriteLog(string text)
if (!logging)
return;
if (s_logFileWriter == null)
{
try
{
s_logFileWriter = new StreamWriter(Path.Combine(logPath, "Microsoft.Build.Tasks.log"), false);
Expand All @@ -423,6 +430,8 @@ public static void WriteLog(string text)
{
return;
}
}

s_logFileWriter.WriteLine(text);
s_logFileWriter.Flush();
}
Expand Down