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.
2,846
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
2,818
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
95
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
86
Microsoft.AspNetCore
Microsoft.AspNetCore
80
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
78
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
77
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications. When using NuGet 3.x this package requires at least version 3.4.
76
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
75
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
75
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
74
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
73
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
73
Microsoft.Identity.Client.Extensions.Msal
This package contains extensions to Microsoft Authentication Library for .NET (MSAL.NET)
72
Microsoft.AspNetCore.AzureAppServices.HostingStartup
ASP.NET Core lightup integration with Azure AppServices. This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/1f050242559e7b90ff6c4ee7f99d92b3a5af5a62
71
Microsoft.AspNetCore
Microsoft.AspNetCore
70
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/27e4e1aca3863389098b9be6dd9c5b7c030180b8
70
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
69
Microsoft.Identity.Client.Extensions.Msal
This package contains extensions to Microsoft Authentication Library for .NET (MSAL.NET)
69

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 5 11/13/2025
10.0.0-rc.2.25502.107 6 10/14/2025
10.0.0-rc.1.25451.107 5 09/11/2025
10.0.0-preview.7.25380.108 11 08/14/2025
10.0.0-preview.6.25358.103 15 07/17/2025
10.0.0-preview.5.25277.114 20 06/14/2025
10.0.0-preview.4.25258.110 20 05/15/2025
10.0.0-preview.3.25171.5 23 04/13/2025
10.0.0-preview.2.25163.2 24 03/25/2025
10.0.0-preview.1.25080.5 24 02/25/2025
9.0.11 2 11/13/2025
9.0.10 5 10/14/2025
9.0.9 13 09/11/2025
9.0.8 10 08/07/2025
9.0.7 12 07/13/2025
9.0.6 19 06/12/2025
9.0.5 21 05/17/2025
9.0.4 24 04/11/2025
9.0.3 28 03/14/2025
9.0.2 22 02/16/2025
9.0.1 34 01/19/2025
9.0.0 35 11/13/2024
9.0.0-rc.2.24473.5 29 10/09/2024
9.0.0-rc.1.24431.7 40 09/17/2024
9.0.0-preview.7.24405.7 39 08/15/2024
9.0.0-preview.6.24327.7 43 07/10/2024
9.0.0-preview.5.24306.7 39 06/13/2024
9.0.0-preview.4.24266.19 38 05/23/2024
9.0.0-preview.3.24172.9 56 04/13/2024
9.0.0-preview.2.24128.5 41 03/25/2024
9.0.0-preview.1.24080.9 40 03/10/2024
8.0.0 2,844 11/17/2023
8.0.0-rc.2.23479.6 46 10/22/2023
8.0.0-rc.1.23419.4 53 09/14/2023
8.0.0-preview.7.23375.6 60 08/17/2023
8.0.0-preview.6.23329.7 52 08/08/2023
8.0.0-preview.5.23280.8 43 06/28/2023
8.0.0-preview.4.23259.5 55 06/23/2023
8.0.0-preview.3.23174.8 56 04/23/2023
8.0.0-preview.2.23128.3 50 07/10/2023
8.0.0-preview.1.23110.8 50 04/23/2023
7.0.0 60 01/23/2023
7.0.0-rc.2.22472.3 52 07/07/2023
7.0.0-rc.1.22426.10 58 07/08/2023
7.0.0-preview.7.22375.6 45 11/19/2022
7.0.0-preview.6.22324.4 48 12/03/2022
7.0.0-preview.5.22301.12 55 11/09/2022
7.0.0-preview.4.22229.4 48 04/18/2023
7.0.0-preview.3.22175.4 50 07/14/2023
7.0.0-preview.2.22152.2 56 04/11/2023
7.0.0-preview.1.22076.8 62 11/04/2022
6.0.2 39 11/13/2024
6.0.2-mauipre.1.22102.15 52 04/10/2023
6.0.2-mauipre.1.22054.8 48 04/14/2023
6.0.1 57 06/07/2022
6.0.0 2,811 12/15/2021
6.0.0-rc.2.21480.5 51 07/11/2023
6.0.0-rc.1.21451.13 48 07/08/2023
6.0.0-preview.7.21377.19 52 12/30/2022
6.0.0-preview.6.21352.12 50 10/06/2022
6.0.0-preview.5.21301.5 54 04/27/2023
6.0.0-preview.4.21253.7 51 10/31/2022
6.0.0-preview.3.21201.4 51 12/25/2022
6.0.0-preview.2.21154.6 52 03/02/2023
6.0.0-preview.1.21102.12 55 05/06/2023
5.0.0 54 12/15/2022
5.0.0-rc.2.20475.5 49 11/04/2022
5.0.0-rc.1.20451.14 54 04/15/2023
5.0.0-preview.8.20407.11 47 07/12/2023
5.0.0-preview.7.20364.11 49 12/23/2022
5.0.0-preview.6.20305.6 59 07/07/2023
5.0.0-preview.5.20278.1 53 04/29/2023
5.0.0-preview.4.20251.6 50 11/21/2022
5.0.0-preview.3.20215.2 51 07/09/2023
5.0.0-preview.2.20160.3 55 05/22/2023
5.0.0-preview.1.20120.4 51 12/29/2022
3.1.32 60 04/01/2023
3.1.31 53 02/16/2023
3.1.30 52 03/12/2023
3.1.29 54 01/16/2023
3.1.28 74 12/19/2022
3.1.27 47 02/26/2023
3.1.26 54 07/14/2023
3.1.25 54 04/02/2023
3.1.24 50 02/24/2023
3.1.23 48 05/05/2023
3.1.22 55 04/09/2023
3.1.21 56 12/21/2022
3.1.20 46 03/30/2023
3.1.19 53 12/28/2022
3.1.18 50 11/27/2022
3.1.17 51 12/23/2022
3.1.16 51 12/18/2022
3.1.15 51 12/27/2022
3.1.14 52 12/28/2022
3.1.13 52 12/17/2022
3.1.12 56 11/11/2022
3.1.11 43 06/11/2022
3.1.10 53 12/28/2022
3.1.9 47 01/30/2023
3.1.8 54 02/22/2023
3.1.7 55 02/24/2023
3.1.6 47 02/10/2023
3.1.5 49 02/14/2023
3.1.4 52 12/30/2022
3.1.3 53 12/11/2022
3.1.2 59 02/21/2023
3.1.1 102 12/24/2022
3.1.0 51 12/21/2022
3.1.0-preview3.19553.2 52 07/10/2023
3.1.0-preview2.19525.4 46 07/09/2023
3.1.0-preview1.19506.1 43 07/08/2023
3.0.3 54 12/30/2022
3.0.2 52 12/31/2022
3.0.1 56 12/17/2022
3.0.0 50 12/25/2022
3.0.0-rc1.19456.10 52 07/11/2023
3.0.0-preview9.19423.4 49 07/09/2023
3.0.0-preview8.19405.4 51 05/14/2023
3.0.0-preview7.19362.4 41 07/09/2023
3.0.0-preview6.19304.6 55 10/13/2022
3.0.0-preview5.19227.9 55 07/09/2023
3.0.0-preview4.19216.2 53 07/07/2023
3.0.0-preview3.19153.1 51 07/11/2023
3.0.0-preview.19074.2 53 05/12/2023
3.0.0-preview.18572.1 44 07/09/2023
2.2.4 54 02/02/2023
2.2.0 57 12/28/2022
2.2.0-preview3-35497 61 10/20/2022
2.2.0-preview2-35157 48 04/23/2023
2.2.0-preview1-35029 57 10/13/2022
2.1.1 54 06/07/2022
2.1.0 50 12/18/2022
2.1.0-rc1-final 44 04/14/2023
2.1.0-preview2-final 57 12/31/2022
2.1.0-preview1-final 51 12/11/2022
2.0.2 54 12/21/2022
2.0.1 54 12/21/2022
2.0.0 55 06/07/2022
2.0.0-preview2-final 48 04/21/2023
2.0.0-preview1-final 56 12/14/2022
1.1.2 51 03/22/2023
1.1.1 50 12/25/2022
1.1.0 52 02/22/2023
1.1.0-preview1-final 47 01/26/2023
1.0.2 50 12/21/2022
1.0.1 47 12/11/2022
1.0.0 45 12/15/2022
1.0.0-rc2-final 52 03/04/2023
1.0.0-rc1-final 53 12/21/2022