Skip to content

Commit 42b14be

Browse files
author
Sergey Komisarchik
committed
DependencyContextAssemblyFinder fix: yield packages with serilog name at the start of any dependency
1 parent 5ac6a59 commit 42b14be

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Serilog.Settings.Configuration/Settings/Configuration/Assemblies/DependencyContextAssemblyFinder.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ where IsCaseInsensitiveMatch(assemblyName.Name, nameToFind)
2727

2828
static bool IsReferencingSerilog(Library library)
2929
{
30-
return library.Dependencies.Any(dependency => dependency.Name.IndexOf("serilog", StringComparison.OrdinalIgnoreCase) >= 0);
30+
const string Serilog = "serilog";
31+
return library.Dependencies.Any(dependency =>
32+
dependency.Name.StartsWith(Serilog, StringComparison.OrdinalIgnoreCase) &&
33+
(dependency.Name.Length == Serilog.Length || dependency.Name[Serilog.Length] == '.'));
3134
}
3235
}
3336
}

0 commit comments

Comments
 (0)