Skip to content

Update Mono.Cecil dependency version to 0.11.4 #1351

@searoz

Description

@searoz

Hello.

The latest (at the time of this post - 3.1.2) version of Coverlet uses Mono.Cecil 0.11.1. Unfortunately, this is an outdated version of Mono.Cecil that contains some bugs. For example, const null arrays are not processed correctly:

using Mono.Cecil;
using Mono.Cecil.Rocks;

await using var moduleStream = File.OpenRead(typeof(TestClass).Assembly.Location);

using var module = ModuleDefinition.ReadModule(moduleStream, new ReaderParameters { ReadSymbols = true });
var type = module.GetType(string.Empty, nameof(TestClass));
var method = type.GetMethods().Single();

try
{
    var debugInformation = method.DebugInformation; // fails on Mono.Cecil 0.11.1, works fine on 0.11.4
    Console.WriteLine("Success");
}
catch (Exception ex)
{
    Console.WriteLine("Error: {0}", ex);
}

public class TestClass
{
    public void TestMethod()
    {
        const object[]? testVariable = null;
    }
}

This prevents Coverlet from instumenting modules and calculating code coverage correctly.

It would be nice if you could update Mono.Cecil dependency to 0.11.4. Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementGeneral enhancement request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions