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
Original file line number Diff line number Diff line change
Expand Up @@ -319,17 +319,15 @@ public bool IsAttributeDefined<TAttribute>(ICustomAttributeProvider attributePro
TAttribute? first = null;
foreach (Attribute attr in GetCustomAttributesCached(attributeProvider))
{
if (attr is not TAttribute match)
if (attr is TAttribute match)
{
continue;
}
if (first is not null)
{
throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Found multiple attributes of type '{0}' when only one was expected.", typeof(TAttribute)));
}

if (first is not null)
{
throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Found multiple attributes of type '{0}' when only one was expected.", typeof(TAttribute)));
first = match;
}

first = match;
}

return first;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ public void Dispose()
Directory.Delete(_deploymentDirectory, recursive: true);
}
}
catch (IOException ex)
{
Debug.WriteLine($"Best-effort cleanup of deployment directory '{_deploymentDirectory}' failed: {ex}");
}
catch (UnauthorizedAccessException ex)
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
{
Debug.WriteLine($"Best-effort cleanup of deployment directory '{_deploymentDirectory}' failed: {ex}");
}
Expand Down
Loading