Repository navigation
Use Roslyn interceptors feature in config binder generator #89322
Description
Activity
Can take this opportunity to fix #86363.
@tarekgh @ericstj @eiriktsarpalis looks like the interceptors feature requires
<Features>$(Features);InterceptorsPreview</Features>in consuming projects.While the feature is in preview,it seems we should update the SDK to set it ifEnableConfigurationBindingGeneratoris set. Otherwise users would need to set two properties to use the generator.The Web SDK already sets the feature property when binding & RDG generates are enabled, so the concern is about regular SDK scenarios.
@layomia does the interceptor feature will be released the same way? I mean users have to opt-in to get it. Or is this temporary for preview and will change when it gets released?
Yes I believe interceptors will be shipped as a preview feature in GA. cc @captainsafia.
We can do the same thing as RDG here. Just add us to this condition:
https://github.com/dotnet/sdk/blob/b3b5a2800d4de997572068332bf222e2e8f808d5/src/WebSdk/ProjectSystem/Targets/Microsoft.NET.Sdk.Web.ProjectSystem.targets#L62-L65We could do the same in our nuget package targets:
https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Configuration.Binder/src/buildTransitive/Microsoft.Extensions.Configuration.Binder.targetsMight be good to have a safeguard in the generator just in case someone manages to invoke it without setting that property. I suspect RDG needs the same as well (eg Web class library that get's referenced by a normal app or class library).
- ghost addedin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
on Aug 10, 2023 - ghost removedin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
on Aug 19, 2023 - ghost locked as resolved and limited conversation to collaborators
on Sep 18, 2023
ref: @captainsafia's work on the request delegate source generator - dotnet/aspnetcore#48817.
cc @tarekgh @eerhardt @ericstj.