DEV Community

Senad Meškin
Senad Meškin

Posted on

3 2

ASP.NET Core - IIS Set environment in web.config

In order to set a Environment variable for the IIS hosted app via web.config we need to add <EnvironmentVariables> element inside the <aspNetCore> element.

<environmentVariables>
    <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
</environmentVariables>
Enter fullscreen mode Exit fullscreen mode

Example of your config should look like this:

 <aspNetCore processPath="dotnet" arguments=".\YourApp.dll" 
                        stdoutLogEnabled="false" 
                        stdoutLogFile=".\logs\stdout" 
                        hostingModel="inprocess">
    <environmentVariables>
        <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
    </environmentVariables>

</aspNetCore>
Enter fullscreen mode Exit fullscreen mode

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more