© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•15mo ago•
69 replies
Jiry_XD

✅ Asp .NET Core production settings.json question.

Hi all,

As you know you have an appsettings.json file.

Which contains some general things such as:
{
    "ConnectionStrings": {
        "SqlServer": "afakeconnstring, you should not store it here, overridden with usersecrets"
    },
    "Logging": {
        "LogLevel": {
            "Default": "Information",
            "Microsoft.AspNetCore": "Warning",
            "EntityFrameworkCore.Triggered": "Warning"
        }
    },
    "AllowedHosts": "*"
}
{
    "ConnectionStrings": {
        "SqlServer": "afakeconnstring, you should not store it here, overridden with usersecrets"
    },
    "Logging": {
        "LogLevel": {
            "Default": "Information",
            "Microsoft.AspNetCore": "Warning",
            "EntityFrameworkCore.Triggered": "Warning"
        }
    },
    "AllowedHosts": "*"
}


We also have a launchsettings.json file
{
  "profiles": {
    "https": {
      "commandName": "Project",
      "launchBrowser": true,
      "launchUrl": "swagger",
      "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
      "applicationUrl": "https://localhost:5001;http://localhost:5000",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "dotnetRunMessages": true
    }
  }
}
{
  "profiles": {
    "https": {
      "commandName": "Project",
      "launchBrowser": true,
      "launchUrl": "swagger",
      "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
      "applicationUrl": "https://localhost:5001;http://localhost:5000",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "dotnetRunMessages": true
    }
  }
}


In production when we publish our app, what is the default running environment?
How do I set the ASPNETCORE_ENVIRONMENT to "Production" in production?
How do I set a seperate ConnectionString_SqlServer for production?

Does the published production build have these .json files or do they rely solely on the HOST environment variables?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

❔ Access AppSettings.json in asp.net core
C#CC# / help
3y ago
❔ ASP.NET to .net Core
C#CC# / help
3y ago
ASP.NET CORE MVC VS ASP.NET CORE WEB API
C#CC# / help
17mo ago