Add env variables config

This commit is contained in:
Serghei Cebotari 2024-11-14 23:51:44 +03:00
parent ded0520756
commit 2dd664df0a
3 changed files with 4 additions and 1 deletions

View File

@ -8,6 +8,7 @@
<Reference Path="Microsoft.Extensions.Caching.Memory.dll" Pack="true" />
<Reference Path="Microsoft.Extensions.Configuration.Abstractions.dll" Pack="true" />
<Reference Path="Microsoft.Extensions.Configuration.dll" Pack="true" />
<Reference Path="Microsoft.Extensions.Configuration.EnvironmentVariables.dll" Pack="true" />
<Reference Path="Microsoft.Extensions.Configuration.FileExtensions.dll" Pack="true" />
<Reference Path="Microsoft.Extensions.Configuration.Json.dll" Pack="true" />
<Reference Path="Microsoft.Extensions.Configuration.UserSecrets.dll" Pack="true" />

View File

@ -21,8 +21,9 @@
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.1" />
<PackageReference Include="netDxf" Version="2022.11.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />

View File

@ -22,6 +22,7 @@ public class AddInConfiguration : IAddInConfiguration
{
_configuration = new ConfigurationBuilder()
.AddUserSecrets<RhSolutionsAddIn>()
.AddEnvironmentVariables("RHS_ADDIN__")
.Build();
_rootKey = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\RhSolutions\RhSolutions-AddIn");