📄 IrbyImaging/Properties/launchSettings.json Documentation

Welcome to the detailed documentation for launchSettings.json in the IrbyImaging project. This file configures how your ASP.NET Core application starts locally—defining profiles, URLs, environment variables, and IIS Express settings.


📑 Table of Contents

  1. Overview & Purpose
  2. File Structure
  3. Launch Profiles
    1. IIS Express Profile
    2. IrbyImaging (Project) Profile
  4. IIS Settings
  5. UML Diagram (Structure)
  6. Usage Examples
  7. Adding/Customizing Profiles
  8. Conclusion

🧐 Overview & Purpose

launchSettings.json is a special file used by .NET Core SDK and Visual Studio to configure:

  • Profiles for debugging (e.g., IIS Express, Kestrel).
  • Environment variables (e.g., ASPNETCORE_ENVIRONMENT).
  • URLs to launch your browser at startup.
  • IIS Express authentication & SSL ports.

Why it matters: Developers can quickly switch between environments (Development, Staging, Production) and hosts without manual command‑line flags.


📂 File Structure

{
  "profiles": { /* Debug profiles */ },
  "iisSettings": { /* IIS Express settings */ }
}
Section Purpose
profiles Defines named launch configurations for your app.
iisSettings Configures IIS Express (Windows) specifics for debugging.

🚀 Launch Profiles

1. IIS Express Profile

"IIS Express": {
  "commandName": "IISExpress",
  "launchBrowser": true,
  "environmentVariables": {
    "ASPNETCORE_ENVIRONMENT": "Development"
  }
}
Property Description
commandName Host to run under (IISExpress).
launchBrowser true opens a browser window at start.
environmentVariables Sets ASPNETCORE_ENVIRONMENT=Development.

When to use

  • Quickly debug using IIS Express in Visual Studio (F5).
  • Utilize Windows authentication or debugging features.

2. IrbyImaging (Project) Profile

"IrbyImaging": {
  "commandName": "Project",
  "launchBrowser": true,
  "environmentVariables": {
    "ASPNETCORE_ENVIRONMENT": "Development"
  },
  "dotnetRunMessages": "true",
  "applicationUrl": "https://www.irbysystems.com"
}
Property Description
commandName Launches via dotnet run (Kestrel).
launchBrowser Opens default browser at applicationUrl.
dotnetRunMessages true to show runtime start‑up messages in console.
applicationUrl Base URL for local debugging (https://www.irbysystems.com).

When to use

  • Debug outside of Visual Studio (VS Code, Rider).
  • Mirror a production‑like URL locally.
  • See Kestrel logs & startup info directly.

⚙️ IIS Settings

"iisSettings": {
  "windowsAuthentication": false,
  "anonymousAuthentication": true,
  "iisExpress": {
    "applicationUrl": "http://localhost:50828",
    "sslPort": 44376
  }
}
Property Description
windowsAuthentication false → disables Windows auth.
anonymousAuthentication true → allows anonymous HTTP access.
iisExpress.applicationUrl Base HTTP URL when using IIS Express.
iisExpress.sslPort SSL port for HTTPS when debugging.

📊 UML Diagram (Structure)

classDiagram
    LaunchSettings --> Profiles
    LaunchSettings --> IISSettings
    Profiles o-- Profile
    IISSettings --> IISExpressSettings

    class LaunchSettings {
      +Dictionary<string,Profile> profiles
      +IISSettings iisSettings
    }
    class Profile {
      +string commandName
      +bool launchBrowser
      +Dictionary<string,string> environmentVariables
      +string? dotnetRunMessages
      +string? applicationUrl
    }
    class IISSettings {
      +bool windowsAuthentication
      +bool anonymousAuthentication
      +IISExpressSettings iisExpress
    }
    class IISExpressSettings {
      +string applicationUrl
      +int sslPort
    }

🔧 Usage Examples

1. Launch via Visual Studio

  1. Set your Startup Profile (top toolbar) to IIS Express or IrbyImaging.
  2. Press F5.
  3. Browser opens at configured URL.

2. Launch via CLI

cd IrbyImaging
dotnet run --launch-profile "IrbyImaging"

This respects applicationUrl and shows detailed run messages.

3. Switch Environment

Inside launchSettings.json, change:

"ASPNETCORE_ENVIRONMENT": "Staging"

or override via CLI:

set ASPNETCORE_ENVIRONMENT=Production
dotnet run

✍️ Adding/Customizing Profiles

  1. Open launchSettings.json.
  2. Under "profiles", copy an existing block.
  3. Rename the profile key (e.g., "Staging").
  4. Adjust applicationUrl & environment variables.
  5. Save, then select new profile in your IDE.
"Staging": {
  "commandName": "Project",
  "launchBrowser": false,
  "environmentVariables": {
    "ASPNETCORE_ENVIRONMENT": "Staging"
  },
  "applicationUrl": "https://staging.irbysystems.com"
}

✅ Conclusion

  • launchSettings.json centralizes local‑host debugging configurations.
  • Two built‑in profiles:
    • IIS Express (Visual Studio)
    • IrbyImaging (CLI & Kestrel)
  • Customize host URLs, environment flags, and authentication.

With well‑configured launch settings, your team can spin up the application consistently across machines—boosting productivity and reducing “it works on my machine” scenarios! 🚀


Happy coding! 😊