Skip to content

Commit

Permalink
Enable interceptors implicitly in binder gen nupkg when generator is …
Browse files Browse the repository at this point in the history
…enabled
  • Loading branch information
layomia committed Sep 1, 2023
1 parent 2aea244 commit 6ee347c
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project InitialTargets="NETStandardCompatError_Microsoft_Extensions_Configuration_Binder">
<Target Name="_Microsoft_Extensions_Configuration_BinderRemoveAnalyzer"
<Target Name="_Microsoft_Extensions_Configuration_Binder_RemoveAnalyzer"
Condition="'$(EnableConfigurationBindingGenerator)' != 'true'"
AfterTargets="ResolvePackageDependenciesForBuild;ResolveNuGetPackageAssets">

Expand All @@ -8,6 +8,16 @@
</ItemGroup>
</Target>

<Target Name="_Microsoft_Extensions_Configuration_Binder_EnableInterceptors"
Condition="'$(EnableConfigurationBindingGenerator)' == 'true'"
AfterTargets="ResolvePackageDependenciesForBuild;ResolveNuGetPackageAssets">

<PropertyGroup>
<!-- The configuration binding source generator uses a preview version of the compiler interceptors feature. Enable it implicitly when the generator is enabled. -->
<InterceptorsPreviewNamespaces>$(InterceptorsPreviewNamespaces);Microsoft.Extensions.Configuration.Binder.SourceGeneration</InterceptorsPreviewNamespaces>
</PropertyGroup>
</Target>

<Target Name="NETStandardCompatError_Microsoft_Extensions_Configuration_Binder"
Condition="'$(SuppressTfmSupportBuildWarnings)' == ''">
<PropertyGroup>
Expand Down

0 comments on commit 6ee347c

Please sign in to comment.