Whatever was passed to CreateBuilderAsync should be used instead.
For example, if I write my custom Main and do the following:
if (args.Length == 0)
{
args = ["--retry-failed-tests", "1"];
}
var builder = await TestApplication.CreateBuilderAsync(args);
SelfRegisteredExtensions.AddSelfRegisteredExtensions(builder, args);
using var app = await builder.BuildAsync();
return await app.RunAsync();
Retry extension will throw an exception, because GetCurrentExecutableInfo doesn't have the correct arguments.
One important scenario to not regress is if we are running under dotnet.exe.
Whatever was passed to
CreateBuilderAsyncshould be used instead.For example, if I write my custom
Mainand do the following:Retry extension will throw an exception, because
GetCurrentExecutableInfodoesn't have the correct arguments.One important scenario to not regress is if we are running under
dotnet.exe.