Skip to content

Commit 765f6ad

Browse files
authored
Annotate Azure.Security.KeyVault.Secrets for trim/AOT compat (Azure#46613)
* Annotate Azure.Security.KeyVault.Secrets for trim/AOT compat * Remove ExpectedWarningsFilepath
1 parent 5386869 commit 765f6ad

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

sdk/keyvault/Azure.Security.KeyVault.Secrets/src/SecretClientBuilderExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT License.
33

44
using System;
5+
using System.Diagnostics.CodeAnalysis;
56
using Azure.Core.Extensions;
67
using Azure.Security.KeyVault.Secrets;
78

@@ -24,6 +25,8 @@ public static IAzureClientBuilder<SecretClient, SecretClientOptions> AddSecretCl
2425
/// <summary>
2526
/// Registers a <see cref="SecretClient"/> instance with connection options loaded from the provided <paramref name="configuration"/> instance.
2627
/// </summary>
28+
[RequiresUnreferencedCode("Binding strongly typed objects to configuration values is not supported with trimming. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
29+
[RequiresDynamicCode("Binding strongly typed objects to configuration values requires generating dynamic code at runtime, for example instantiating generic types. Use the Configuration Binder Source Generator (EnableConfigurationBindingGenerator=true) instead.")]
2730
public static IAzureClientBuilder<SecretClient, SecretClientOptions> AddSecretClient<TBuilder, TConfiguration>(this TBuilder builder, TConfiguration configuration)
2831
where TBuilder : IAzureClientFactoryBuilderWithConfiguration<TConfiguration>
2932
{

sdk/keyvault/Azure.Security.KeyVault.Secrets/tests/compatibility/ExpectedAotWarnings.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

sdk/keyvault/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ extends:
4242
CheckAOTCompat: true
4343
AOTTestInputs:
4444
- ArtifactName: Azure.Security.KeyVault.Secrets
45-
ExpectedWarningsFilepath: /Azure.Security.KeyVault.Secrets/tests/compatibility/ExpectedAotWarnings.txt
45+
ExpectedWarningsFilepath: None

0 commit comments

Comments
 (0)