-
|
There's a good chance I've just missed something obvious in the docs here... I'm experimenting with the new reflection-free code paths, and have swapped out So how to do I enable generated request building? There's docs around disabling various source-gen things, but I'm clearly missing diagnostics/info on a. why the code gen has failed/fallen back for this method, and b. how to correct that... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
That message means the generated client exists, but that particular method did not get the new direct generated-request-building path.
The confusing part is the word "enable". There is no per-method runtime switch to call in DI. In the current README, generated request building is on by default, and the project property shown is the opposite switch: <PropertyGroup>
<RefitGeneratedRequestBuilding>false</RefitGeneratedRequestBuilding>
</PropertyGroup>Setting that to I would debug it like this:
<PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
So the practical choices are:
Relevant source/docs:
If this explains the error path, please mark it as answered. |
Beta Was this translation helpful? Give feedback.
That message means the generated client exists, but that particular method did not get the new direct generated-request-building path.
AddRefitGeneratedClient<T>()is the strict/native-AOT path. It usesRestService.ForGenerated<T>()and deliberately does not register the old reflectionIRequestBuilder<T>fallback. So if one interface method is generated as "call the reflection request builder for this method", resolving/calling it fails with that message.The confusing part is the word "enable". There is no per-method runtime switch to call in DI. In the current README, generated request building is on by default, and the project property shown is the opposite switch: