Silently ignore native binaries during scanning
KirillOsenkov opened this issue · 6 comments
KirillOsenkov commented
Mono Addins crashes when encountering a native binary that's not excluded. Maybe it should instead skip it silently?
Therzok commented
Cecil throws a BadImageFormatException
when it encounters a native library (CLI Header is empty). Maybe we should catch that, and log the assembly not being loaded.
KirillOsenkov commented
Ideally avoid the exception in the first place (I bet Cecil has ways to probe)
Therzok commented
Doesn't look like it does, but this is part of parsing the metadata of a given dll file, so we can safely just catch that exception.
KirillOsenkov commented
@jbevain Jb is there a way to detect a native binary in Cecil and avoid throwing an exception?
KirillOsenkov commented
Here's how I normally do it: https://github.com/KirillOsenkov/SourceBrowser/blob/master/src/Common/IsManagedAssembly.cs