Answers for "set environment variable asp.net core"

C#
1

csharp check if env is development

bool isDevelopment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Development";
Posted by: Guest on May-14-2020
0

.net using appsettings variables

<configuration>
    <appSettings>
        <add key="Domain" value="mycompany.com"/>
        <add key="ServerName" value="db01.{Domain}"/>
    </appSettings>
    <connectionStrings>
        <add name="Default" connectionString="server={ServerName};uid=uid;pwd=pwd;Initial Catalog=master;" provider="System.Data.SqlClient" />
    </connectionStrings>
</configuration>
Posted by: Guest on January-05-2021

C# Answers by Framework

Browse Popular Code Answers by Language