Search code examples
.netuwp.net-native

.NET Native compiler ignores Explicit Method Overriding


In my UWP project I have a library which relies on IL instructions like override.

.method public virtual instance void Method1(string s, object o) {
    .override ClassA::Method2

    // code

}

This IL instruction works in debug but fails when I compile in release.


Solution

  • The .NET Native compiler is currently targeted at IL generated by our C# and VB compilers (the old ones and Roslyn). I'm not perfectly familiar with their output but generally this kind of issue means that "normal" C#/VB never emit such IL.

    There's potentially two paths forward:

    • Redo your IL generator so that it looks more like "typical" C#/VB
    • Shoot us a mail at [email protected] and we'll see what it takes to light this up

    Historically we've tried very hard to be focused on the C#/VB scenario but we've take fixes here and there to help support folks that have "odd" IL constructs. Either way, hearing about your scenario can certainly help us make more informed engineering decisions in the future.