Launchsettings in Asp.net

  • by

This is the place to specify the configurations that are required by the application to be running and hosted.Like the URL in which the app needs to run etc . Also this is the place where we specify the environment name. There are three possible values for the environment namely, development, staging and production. Based on these environments we can adjust the logging and exception handling configurations using the middlewares. The launch setting looks something like the following,

{

 “$schema”: “http://json.schemastore.org/launchsettings.json”,

 “iisSettings”: {

   “windowsAuthentication”: false,

   “anonymousAuthentication”: true,

   “iisExpress”: {

     “applicationUrl”: “http://localhost:5839”,

     “sslPort”: 44394

   }

 },

 “profiles”: {

   “IIS Express”: {

     “commandName”: “IISExpress”,

     “launchBrowser”: true,

     “launchUrl”: “weatherforecast”,

     “environmentVariables”: {

       “ASPNETCORE_ENVIRONMENT”: “Development”

     }

   },

   “API”: {

     “commandName”: “Project”,

     “launchBrowser”: true,

     “launchUrl”: “weatherforecast”,

     “applicationUrl”: “https://localhost:5001;http://localhost:5000”,

     “environmentVariables”: {

       “ASPNETCORE_ENVIRONMENT”: “Development”

     }

   }

 }

}

There are three types of servers through which the application can be hosted namely,the IIS express, web and kestrel. The default and most commonly used server is IIS express.

There is one small change that we might have to do to the launch settings, change the launchBrowser option under API to true, since we are just having a web api application that just will be having a list of endpoints that can be accessed using postman.

Leave a Reply

Your email address will not be published. Required fields are marked *