-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RegisterItemsFromAssembly - Include assemblies from nuget packages (Strict) #2519
RegisterItemsFromAssembly - Include assemblies from nuget packages (Strict) #2519
Conversation
c435d3c
to
883fae2
Compare
Codecov Report
@@ Coverage Diff @@
## master #2519 +/- ##
========================================
Coverage ? 81%
========================================
Files ? 323
Lines ? 23380
Branches ? 2924
========================================
Hits ? 19048
Misses ? 3559
Partials ? 773 |
@@ -427,18 +428,21 @@ private static ConfigurationItemFactory BuildDefaultFactory() | |||
var allAssemblies = LogFactory.CurrentAppDomain.GetAssemblies(); | |||
foreach (var assembly in allAssemblies) | |||
{ | |||
if (assembly.FullName.StartsWith("NLog.", StringComparison.OrdinalIgnoreCase)) | |||
if (assembly.FullName.StartsWith("NLog", StringComparison.OrdinalIgnoreCase)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is less strict? This would match nlogger.dll?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It matches the current: Directory.GetFiles(assemblyLocation, "NLog*.dll")
It is the hidden assembly logic, that is more strict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though I don't mind reverting it back to NLog.
(But then we should consider also fixing the GetFiles
-call (Maybe in NLog ver. 5.0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the getfiles is backwards compatible, isn't? Would prefer that one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope it will suddenly not load NLogSplunkTarget.dll
(Made Up)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But you have convinced me, matching on filename is different from matching on namespace. Have added the dot back, so it remains strict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the filter start with "nlog." was already there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes and now it is back again :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
|| assembly.FullName.StartsWith("Microsoft.Extensions.Logging,", StringComparison.OrdinalIgnoreCase) | ||
|| assembly.FullName.StartsWith("Microsoft.Extensions.Logging.Abstractions,", StringComparison.OrdinalIgnoreCase) | ||
|| assembly.FullName.StartsWith("Microsoft.Extensions.Logging.Filter,", StringComparison.OrdinalIgnoreCase) | ||
|| assembly.FullName.StartsWith("Microsoft.Logging,", StringComparison.OrdinalIgnoreCase)) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the duplicates, it's a "starts with"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice the ,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thanks, hardly to see on mobile.
883fae2
to
dfbe5d7
Compare
dfbe5d7
to
6a804e4
Compare
6a804e4
to
afb4a6d
Compare
Less aggressive, so NLog.Extensions.Logging.Tests doesn't get marked as hidden assembly.