The process that I am running on .NET9 preview 7 under the debugger silently exits either after stepping, or it continuing and breakpoints are set on the lines after var aa = typeof(Action).GetMethod("Invoke").CreateDelegate<Action<Action>>();
Reproduction Steps
class Program
{
static int x;
static void Main()
{
Action a = Work;
a += Work2;
a += Work3;
var aa = typeof(Action).GetMethod("Invoke").CreateDelegate<Action<Action>>();
//for (; ; ) a();
Console.WriteLine("We are here");
for (; ; ) aa(a);
}
static void Work()
{
Console.WriteLine("work");
x += 1;
}
static void Work2()
{
Console.WriteLine("work2");
x += 2;
}
static void Work3()
{
Console.WriteLine("work3");
x += 3;
}
}
Publish this as self-contained, then build the runtime in Debug and patch the Runtime. Put breakpoints on the Console.WriteLine("We are here"); line or the for loop line.
Expected behavior
The program continues and the Console.WriteLine lines print.
Actual behavior
If breakpoints are on either of the lines after var aa = typeof(Action).GetMethod("Invoke").CreateDelegate<Action<Action>>();, then the program and the debugger silently fail and exit.
Regression?
No response
Known Workarounds
Don't set breakpoints and run the program, then it works as expected.
Or just use the self-contained runtime after publishing the app rather than patching a Debug runtime.
Description
The process that I am running on .NET9 preview 7 under the debugger silently exits either after stepping, or it continuing and breakpoints are set on the lines after
var aa = typeof(Action).GetMethod("Invoke").CreateDelegate<Action<Action>>();
Reproduction Steps
Publish this as self-contained, then build the runtime in Debug and patch the Runtime. Put breakpoints on the
Console.WriteLine("We are here");
line or thefor loop
line.Expected behavior
The program continues and the Console.WriteLine lines print.
Actual behavior
If breakpoints are on either of the lines after
var aa = typeof(Action).GetMethod("Invoke").CreateDelegate<Action<Action>>();
, then the program and the debugger silently fail and exit.Regression?
No response
Known Workarounds
Don't set breakpoints and run the program, then it works as expected. Or just use the self-contained runtime after publishing the app rather than patching a Debug runtime.
Configuration
Mac ARM64 -> M1 .NET9, patched Debug build
Other information
No response