diff --git a/Smith.msbuildproj b/Smith.msbuildproj index 358ef88..d7f3b84 100644 --- a/Smith.msbuildproj +++ b/Smith.msbuildproj @@ -1,12 +1,10 @@ - - + net10.0 Smith An opinionated meta-package for doing AI agents using Microsoft.Extensions.AI and MCP $(MSBuildThisFileDirectory)bin - @@ -18,17 +16,15 @@ - - - + + - + - \ No newline at end of file diff --git a/Smith.props b/Smith.props index bc67b24..42b3f1b 100644 --- a/Smith.props +++ b/Smith.props @@ -3,6 +3,7 @@ true enable true + TA001;$(NoWarn) @@ -28,7 +29,7 @@ - + \ No newline at end of file diff --git a/cs/AddUserSecrets.cs b/cs/AddUserSecrets.cs new file mode 100644 index 0000000..311ab78 --- /dev/null +++ b/cs/AddUserSecrets.cs @@ -0,0 +1,22 @@ +namespace Microsoft.Extensions.Configuration; + +/// +/// Provides configuration extensions for adding user secrets configuration source. +/// +public static class UserSecretsConfigurationExtensions +{ + /// + /// + /// Adds the user secrets configuration source with the project-specified user secrets ID. + /// + /// + /// The configuration builder. + /// The configuration builder. + public static IConfigurationBuilder AddUserSecrets(this IConfigurationBuilder configuration) + { + if (!string.IsNullOrEmpty(ThisAssembly.Constants.UserSecretsId)) + return configuration.AddUserSecrets(ThisAssembly.Constants.UserSecretsId, reloadOnChange: false); + + return configuration; + } +} \ No newline at end of file