Microsoft.Extensions.Configuration.EnvironmentVariables 8.0.0-rc.2.23479.6

About

Environment variables configuration provider implementation for Microsoft.Extensions.Configuration. This package enables you to read configuration parameters from environment variables. You can use EnvironmentVariablesExtensions.AddEnvironmentVariables extension method on IConfigurationBuilder to add the environment variables configuration provider to the configuration builder.

How to Use

The following example shows how to read application configuration from environment variables.

using System;
using Microsoft.Extensions.Configuration;

class Program
{
    static void Main()
    {
        // Build a configuration object from environment variables
        IConfiguration config = new ConfigurationBuilder()
            .AddEnvironmentVariables()
            .Build();
        
        // Read configuration values
        Console.WriteLine($"Server: {config["Server"]}");
        Console.WriteLine($"Database: {config["Database"]}");
    }
}

Additional Documentation

Feedback & Contributing

Microsoft.Extensions.Configuration.EnvironmentVariables is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Showing the top 20 packages that depend on Microsoft.Extensions.Configuration.EnvironmentVariables.

Packages Downloads
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
1,449
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
1,419
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications. This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/be0a4a7f4cf06cbd6ec714bd1d9afee6bdb040a8
74
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
62
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
59
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
57
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
56
Microsoft.AspNetCore
Microsoft.AspNetCore
55
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications. When using NuGet 3.x this package requires at least version 3.4.
55
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
53
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications. This package was built from the source at: https://github.com/aspnet/Hosting/tree/c3edce8e8a19a1e2e58fd21a986271b88071e6ba
53
Microsoft.AspNetCore
Microsoft.AspNetCore
53
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
52
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
52
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
50
Microsoft.AspNetCore
Microsoft.AspNetCore
48
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
48
Microsoft.AspNetCore.AzureAppServices.HostingStartup
ASP.NET Core lightup integration with Azure AppServices. This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/3dfc6fda80a10797b8c8fda1970e7b377fd8ed8d
48

https://go.microsoft.com/fwlink/?LinkID=799421

.NET Framework 4.6.2

.NET 6.0

.NET 7.0

.NET 8.0

.NET Standard 2.0

Version Downloads Last updated
10.0.0-preview.3.25171.5 9 04/13/2025
10.0.0-preview.2.25163.2 10 03/25/2025
10.0.0-preview.1.25080.5 11 02/25/2025
9.0.4 9 04/11/2025
9.0.3 11 03/14/2025
9.0.2 9 02/16/2025
9.0.1 14 01/19/2025
9.0.0 18 11/13/2024
9.0.0-rc.2.24473.5 15 10/09/2024
9.0.0-rc.1.24431.7 26 09/17/2024
9.0.0-preview.7.24405.7 25 08/15/2024
9.0.0-preview.6.24327.7 33 07/10/2024
9.0.0-preview.5.24306.7 27 06/13/2024
9.0.0-preview.4.24266.19 23 05/23/2024
9.0.0-preview.3.24172.9 40 04/13/2024
9.0.0-preview.2.24128.5 29 03/25/2024
9.0.0-preview.1.24080.9 25 03/10/2024
8.0.0 1,420 11/17/2023
8.0.0-rc.2.23479.6 31 10/22/2023
8.0.0-rc.1.23419.4 35 09/14/2023
8.0.0-preview.7.23375.6 44 08/17/2023
8.0.0-preview.6.23329.7 36 08/08/2023
8.0.0-preview.5.23280.8 28 06/28/2023
8.0.0-preview.4.23259.5 38 06/23/2023
8.0.0-preview.3.23174.8 37 04/23/2023
8.0.0-preview.2.23128.3 31 07/10/2023
8.0.0-preview.1.23110.8 36 04/23/2023
7.0.0 42 01/23/2023
7.0.0-rc.2.22472.3 36 07/07/2023
7.0.0-rc.1.22426.10 42 07/08/2023
7.0.0-preview.7.22375.6 32 11/19/2022
7.0.0-preview.6.22324.4 32 12/03/2022
7.0.0-preview.5.22301.12 37 11/09/2022
7.0.0-preview.4.22229.4 29 04/18/2023
7.0.0-preview.3.22175.4 36 07/14/2023
7.0.0-preview.2.22152.2 38 04/11/2023
7.0.0-preview.1.22076.8 43 11/04/2022
6.0.2 20 11/13/2024
6.0.2-mauipre.1.22102.15 40 04/10/2023
6.0.2-mauipre.1.22054.8 34 04/14/2023
6.0.1 38 06/07/2022
6.0.0 1,445 12/15/2021
6.0.0-rc.2.21480.5 36 07/11/2023
6.0.0-rc.1.21451.13 32 07/08/2023
6.0.0-preview.7.21377.19 37 12/30/2022
6.0.0-preview.6.21352.12 35 10/06/2022
6.0.0-preview.5.21301.5 40 04/27/2023
6.0.0-preview.4.21253.7 36 10/31/2022
6.0.0-preview.3.21201.4 38 12/25/2022
6.0.0-preview.2.21154.6 38 03/02/2023
6.0.0-preview.1.21102.12 39 05/06/2023
5.0.0 40 12/15/2022
5.0.0-rc.2.20475.5 34 11/04/2022
5.0.0-rc.1.20451.14 38 04/15/2023
5.0.0-preview.8.20407.11 28 07/12/2023
5.0.0-preview.7.20364.11 37 12/23/2022
5.0.0-preview.6.20305.6 37 07/07/2023
5.0.0-preview.5.20278.1 39 04/29/2023
5.0.0-preview.4.20251.6 30 11/21/2022
5.0.0-preview.3.20215.2 35 07/09/2023
5.0.0-preview.2.20160.3 36 05/22/2023
5.0.0-preview.1.20120.4 39 12/29/2022
3.1.32 40 04/01/2023
3.1.31 33 02/16/2023
3.1.30 34 03/12/2023
3.1.29 38 01/16/2023
3.1.28 38 12/19/2022
3.1.27 33 02/26/2023
3.1.26 37 07/14/2023
3.1.25 36 04/02/2023
3.1.24 37 02/24/2023
3.1.23 35 05/05/2023
3.1.22 39 04/09/2023
3.1.21 37 12/21/2022
3.1.20 32 03/30/2023
3.1.19 35 12/28/2022
3.1.18 34 11/27/2022
3.1.17 35 12/23/2022
3.1.16 40 12/18/2022
3.1.15 38 12/27/2022
3.1.14 35 12/28/2022
3.1.13 38 12/17/2022
3.1.12 42 11/11/2022
3.1.11 32 06/11/2022
3.1.10 38 12/28/2022
3.1.9 34 01/30/2023
3.1.8 37 02/22/2023
3.1.7 36 02/24/2023
3.1.6 33 02/10/2023
3.1.5 37 02/14/2023
3.1.4 31 12/30/2022
3.1.3 36 12/11/2022
3.1.2 38 02/21/2023
3.1.1 52 12/24/2022
3.1.0 39 12/21/2022
3.1.0-preview3.19553.2 37 07/10/2023
3.1.0-preview2.19525.4 34 07/09/2023
3.1.0-preview1.19506.1 30 07/08/2023
3.0.3 40 12/30/2022
3.0.2 36 12/31/2022
3.0.1 40 12/17/2022
3.0.0 33 12/25/2022
3.0.0-rc1.19456.10 39 07/11/2023
3.0.0-preview9.19423.4 35 07/09/2023
3.0.0-preview8.19405.4 41 05/14/2023
3.0.0-preview7.19362.4 30 07/09/2023
3.0.0-preview6.19304.6 44 10/13/2022
3.0.0-preview5.19227.9 39 07/09/2023
3.0.0-preview4.19216.2 33 07/07/2023
3.0.0-preview3.19153.1 31 07/11/2023
3.0.0-preview.19074.2 34 05/12/2023
3.0.0-preview.18572.1 32 07/09/2023
2.2.4 37 02/02/2023
2.2.0 38 12/28/2022
2.2.0-preview3-35497 47 10/20/2022
2.2.0-preview2-35157 33 04/23/2023
2.2.0-preview1-35029 46 10/13/2022
2.1.1 39 06/07/2022
2.1.0 34 12/18/2022
2.1.0-rc1-final 34 04/14/2023
2.1.0-preview2-final 39 12/31/2022
2.1.0-preview1-final 31 12/11/2022
2.0.2 41 12/21/2022
2.0.1 39 12/21/2022
2.0.0 37 06/07/2022
2.0.0-preview2-final 33 04/21/2023
2.0.0-preview1-final 39 12/14/2022
1.1.2 33 03/22/2023
1.1.1 37 12/25/2022
1.1.0 34 02/22/2023
1.1.0-preview1-final 32 01/26/2023
1.0.2 34 12/21/2022
1.0.1 33 12/11/2022
1.0.0 33 12/15/2022
1.0.0-rc2-final 39 03/04/2023
1.0.0-rc1-final 41 12/21/2022