-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable ConfigurationBinder source gen on components by default #535
Conversation
Also enable IsAotCompatible, so we get warnings when using non-AOT compatible code.
Seems good. Is there a reason this is still draft? |
Yes. Doesn't work yet. I need to explicitly reference the 8.0 config binder package, and then work around issues. |
…nsions.Configuration.Binder, which brings in the latest version that contains the source generator.
I needed to work around a couple bugs in the Source Generator, which I linked in the code. I was blocked on 3 Azure Components though. I couldn't find a workaround to get it enabled. |
Directory.Packages.props
Outdated
@@ -11,6 +11,7 @@ | |||
<PackageVersion Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.2.2" /> | |||
<PackageVersion Include="Azure.Identity" Version="1.10.0" /> | |||
<PackageVersion Include="Azure.Messaging.ServiceBus" Version="7.15.0" /> | |||
<PackageVersion Include="Azure.Messaging.EventHubs" Version="5.9.2" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed until Xabaril/AspNetCore.Diagnostics.HealthChecks#2038 is shipped in a version on nuget. The ServiceBus health check brings in EventHubs, and I needed to add an explicit alias to work around the source generator bug.
@ericstj - have you ever seen this error before? It is coming from the 2 Azure Components that I tried the work around by using an |
Also tagging @tmat - have you ever seen the above error coming from |
I ended up reverting the Azure Components changes all together. None of them will use the ConfigBinder Source Generator due to the above Pdb2Pdb.exe error. When the underlying issues are fixed in the Source Generator, we will re-enable it for the Azure components. |
@@ -76,6 +78,18 @@ private sealed class TableServiceComponent : AzureComponent<AzureDataTablesSetti | |||
}, requiresCredential: false); | |||
} | |||
|
|||
protected override void BindClientOptionsToConfiguration(IAzureClientBuilder<TableServiceClient, TableClientOptions> clientBuilder, IConfiguration configuration) | |||
{ | |||
#pragma warning disable IDE0200 // Remove unnecessary lambda expression - needed so the ConfigBinder Source Generator works |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I should just make IDE0200 a suggestion? This seems like a pretty aggressive warning.
Yeah, let's just get the issues fixed in configuration to unblock these scenarios. |
* Enable ConfigurationBinder source gen on all components. Also enable IsAotCompatible, so we get warnings when using non-AOT compatible code. * Make the Source Generator actually work by referencing Microsoft.Extensions.Configuration.Binder, which brings in the latest version that contains the source generator. * Revert Azure components due to Pdb2Pdb error for extern alias.
Now that 8.0.1 has shipped, we can remove the workarounds added in dotnet#535.
Now that 8.0.1 has shipped, we can remove the workarounds added in #535.
Also enable IsAotCompatible, so we get warnings when using non-AOT compatible code.