andreasohlund / APIComparer

Compares NuGetPackages/Assemblies and displays changes in the public api.
MIT License
51 stars 4 forks source link

Comparing LibGit2Sharp blows with "Format of the executable (.exe) or library (.dll) is invalid." #47

Closed andreasohlund closed 9 years ago

andreasohlund commented 9 years ago

To repro just execute

http://localhost:2321/compare/LibGit2Sharp/0.20.1...0.20.2

causes Mono.Cecil to blow with mentioned ex.

andreasohlund commented 9 years ago

cc @SimonCropp @nulltoken

nulltoken commented 9 years ago

@andreasohlund :heart: for having taken a look at this.

causes Mono.Cecil to blow with mentioned ex.

Most certainly due to trying to load one of the native binaries as a managed one.

A try/catch (BadImageFormatException e) should work around this. FWIW, this is the way it's been solved by the scriptcs project

nulltoken commented 9 years ago

Unless someone beats me to it, I'll try to send a PR tomorrow. Cool with you?

andreasohlund commented 9 years ago

That would be awesome. One way to integration test this would be to add a similar test to https://github.com/ParticularLabs/APIComparer/blob/master/APIComparer.Backend.Tests/APIUpgradeToHtmlFormatterTest.cs#L13

On Fri, Sep 4, 2015 at 8:45 PM, nulltoken notifications@github.com wrote:

Unless someone beats me to it, I'll try to send a PR tomorrow. Cool with you?

— Reply to this email directly or view it on GitHub https://github.com/ParticularLabs/APIComparer/issues/47#issuecomment-137818148 .

andreasohlund commented 9 years ago

We have some code in NServiceBus to exclude non .net asm that could be used as inspiration :)

https://github.com/Particular/NServiceBus/blob/develop/src/NServiceBus.Core/Hosting/Helpers/AssemblyScanner.cs#L171