Skip to content

Add --start flag to codegen command for Startup.Configure() pattern#173

Merged
jeremydmiller merged 1 commit intomainfrom
codegen-start-flag
Mar 29, 2026
Merged

Add --start flag to codegen command for Startup.Configure() pattern#173
jeremydmiller merged 1 commit intomainfrom
codegen-start-flag

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Summary

  • Adds a --start flag to the codegen command that calls host.StartAsync() before running code generation
  • When using the old ASP.NET Core Startup.Configure() hosting pattern, code generation participants (like Wolverine.Http's MapWolverineEndpoints()) are registered during host startup, not during Build(). Without --start, the codegen command only calls Build(), so these participants are never discovered.
  • Usage: dotnet run -- codegen write --start
  • Added smoke test for codegen preview --start in the CI build
  • Bumps JasperFx to 1.21.6

Test plan

  • All 275 CommandLineTests pass
  • All 296 CodegenTests pass
  • All 388 CoreTests pass
  • Smoke test: codegen preview --start successfully starts the host before running codegen
  • Without --start, behavior is unchanged (host is only built, not started)

🤖 Generated with Claude Code

When using the old ASP.NET Core Startup.Configure() hosting pattern,
code generation participants like Wolverine.Http's MapWolverineEndpoints()
are registered during host startup, not during Build(). The codegen
command only calls Build(), so these participants are never discovered
and no HTTP endpoint code is generated.

The new --start flag tells the codegen command to call host.StartAsync()
before running code generation, ensuring Configure() executes and all
participants are registered.

Usage: dotnet run -- codegen write --start

Bump JasperFx to 1.21.6.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jeremydmiller jeremydmiller merged commit c5ab320 into main Mar 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant