Hello Lazie,
I believe that you may want to use System.Windows ShowDialog instead of Windows Controls TaskDialog from the Win32 API. For C# .Net Core 5 the ShowDialog is normally used.
system.windows.window.showdialog
I suppose the System.Windows.Window.ShowDialog will run anywhere that the .Net Core 5 runs. Have you already arrived at this conclusion?