Skip to content
Discussion options

You must be logged in to vote

The Refit source generator only runs against interfaces that:

  • live in a project that references the Refit package (so the generator is loaded), and
  • have at least one method decorated with a Refit HTTP method attribute ([Get], [Post], etc.).

Common reasons "my own APIs don't trigger the generator":

  • The interface is defined in a different assembly/project that does not reference Refit, so the generator never sees it. The generator runs per-compilation; it does not cross into projects that lack the Refit reference.
  • The package reference is a plain <PackageReference> with PrivateAssets/IncludeAssets set so analyzers are excluded. Make sure the analyzer asset is included (the default Refit

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by glennawatson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants