Skip to content

[mono] Exceptions thrown in loader events are not propagated correctly #43909

@CoffeeFlux

Description

@CoffeeFlux

Affects both legacy and netcore Mono. This is higher importance than it initially seems, because xunit depends on this exception propagation for its asserts. Without this issue fixed, tests can fail and still be reported as passing.

Example:

using System;

namespace HelloWorld
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            AppDomain.CurrentDomain.AssemblyResolve += (sender, e) =>
            {
                throw new Exception("Fail!");
            };
            var t = Type.GetType("Some.Assembly.Type, Some.Assembly");
        }
    }
}

This throws with CoreCLR and succeeds on Mono. It should throw on both.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions