diff --git a/src/System.CommandLine.Minimal.SourceGenerator/CommandOptionsWriter.cs b/src/System.CommandLine.Minimal.SourceGenerator/CommandOptionsWriter.cs index 070c177..d9e96a9 100644 --- a/src/System.CommandLine.Minimal.SourceGenerator/CommandOptionsWriter.cs +++ b/src/System.CommandLine.Minimal.SourceGenerator/CommandOptionsWriter.cs @@ -47,7 +47,7 @@ public static class Configure{{binder.CommandNameTitleCase}}BuilderExtensions ); // do not add the class to services if it's static if (!binder.MethodIsStatic) - sb.AppendLine($" builder.Services.TryAddTransient<{binder.CommandOptionsName}>();"); + sb.AppendLine($" builder.Services.TryAddTransient<{binder.FullClassName}>();"); sb.AppendLine( $$""" {{binder.CommandOptionsName}} cliOptions = builder.TryRegisterCommandOptions<{{binder.CommandOptionsName}}>();