launchsettings.json in Asp.Net Core | Asp.Net Core tutorial
launchSettings.json in asp.net core application is used to set some settings that help to run the application in the development environment.
launchSettings.json in asp.net core application is available under the Properties
folder at the root level.
launchSettings.json in asp.net core application has following main settings:
- IISSettings
- Profiles
- IIS Express (Used in Visual studio)
- One profile with application name (Used for Kestrel server)
Lets have a look on all the properties one by one.
iisSettings
windowsAuthentication
This is used to enable/disable the windows authentication. windowsAuthentication accepts a Boolean (true/false) value.
anonymousAuthentication
This is used to enable/disable anonymous authentication. anonymousAuthentication accepts a Boolean (true/false) value.
iisExpress – applicationUrl
This setting helps the application to run the application using IIS Express (used by Visual Studio). applicationUrl
has the URL of the application with the port number. You can update this port number as per the need.
iisExpress – sslPort
This port is used to run the application on https
.
profiles
By default, there are two profiles, one for the IIS express and another for the application name (use the dotnet run command).
commandName
Command names help to set the default server to run the application in development mode. “IISExpress” is used by the visual studio and “ApplicationName” is used to run the application using the Kestrel web server.
launchBrowser
If sets to true, it will open the default browser with the URL specified in the settings.
environmentVariables
environmentVariables helps the application to understand the current environment. Its value can be accessed using IWebHostEnvironment env
applicationUrl
This URL will be used by the application if it is using Kestrel web server.