Dependency on Mono.Cecil 0.9.6 is not declared
See original GitHub issueWe have a custom test runner (not Visual Studio) to run NUnit tests. The unit-test project in system-under-test is targeting net472 and has the following package references:
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
We end up with nunit.engine.dll 3.9.0.0 in the test output directory. nunit.engine.dll references Mono.Cecil.dll 0.9.6, but the NuGet package https://www.nuget.org/packages/NUnit3TestAdapter/3.15.1 neither declares a dependency on Cecil nor packs its own copy, nor ILRepacks to embed Cecil into nunit.engine.dll.
As a result if our test runner attempts to run tests from that directory the process crashes with Unable to load Mono.Cecil.dll 0.9.6.
If I understand this correctly, it would be better to use ILRepack to inline Cecil into nunit.engine.dll. It is better to inline Cecil because Cecil has changed the public key token between 0.9 and 0.10 and so binding redirects won’t work. Updating to the latest Cecil and declaring that dependency (or including Mono.Cecil.dll in the NuGet package) would work too.
How does this normally work? Does VS bring its own Cecil? Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)

Top Related StackOverflow Question
BTW, it’s also possible to embed Cecil as a single source file this: https://gist.github.com/jcansdale/9eff65dda0eaaa6196f5ef737a569803
Not saying it’s a good thing, but it’s a thing. 😉
It’s not public and I’m using reflection to call it, but don’t worry about breaking us. We’ll adapt.