-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Ensure UserSecretsIdAttribute is added to assembly #63415
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
Conversation
When Microsoft.Extensions.Configuration.UserSecrets is referenced transitively, for example through Extensions.Hosting, the UserSecretsIdAttribute isn't getting added to the built assembly. This is because the logic is contained in a `build` folder which is excluded by the dependency from Extensions.Hosting. The fix is to move the logic to `buildTransitive`, so it gets picked up by NuGet. One wrinkle is that the logic now conflicts with the netstandard compatibility logic added by the library infrastructure. In order to make progress, disable that logic for this package and rely on its dependencies to raise the compat error. Contributes to dotnet#63246
|
Tagging subscribers to this area: @dotnet/area-extensions-configuration Issue DetailsWhen Microsoft.Extensions.Configuration.UserSecrets is referenced transitively, for example through Extensions.Hosting, the UserSecretsIdAttribute isn't getting added to the built assembly. This is because the logic is contained in a The fix is to move the logic to Contributes to #63246
|
tarekgh
left a comment
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.
LGTM. The only thing I hope @ericstj may confirm, disabling the NETStandard Compat target wouldn't have any side effect we didn't think about. The mentioned mitigation makes sense to me though.
|
Is it feasible to have a test? (given this was significant enough to service for) But perhaps that would have to be in the SDK repo since it involves restoring packages? |
I can add a test, but as you said, it will have to be in a different repo since this is a packaging issue. We don't currently have packaging tests in this repo. |
|
Your call, just curious. LMK if you would like me to merge. |
This one is |
I talked with @eerhardt and am OK with this. |
When Microsoft.Extensions.Configuration.UserSecrets is referenced transitively, for example through Extensions.Hosting, the UserSecretsIdAttribute isn't getting added to the built assembly. This is because the logic is contained in a
buildfolder which is excluded by the dependency from Extensions.Hosting.The fix is to move the logic to
buildTransitive, so it gets picked up by NuGet. One wrinkle is that the logic now conflicts with the netstandard compatibility logic added by the library infrastructure. In order to make progress, disable that logic for this package and rely on its dependencies to raise the compat error.Contributes to #63246