• C# .NET5.0 launchSettings.json


    {
      "$schema": "http://json.schemastore.org/launchsettings.json",
      "iisSettings": {
        "windowsAuthentication": false,
        "anonymousAuthentication": true,
        "iisExpress": {
          "applicationUrl": "http://localhost:32462",
          "sslPort": 44348
        }
      },
      "profiles": {
        "IIS Express": {
          "commandName": "IISExpress",
          "launchBrowser": true,
          "launchUrl": "swagger",
          "environmentVariables": {
            "ASPNETCORE_ENVIRONMENT": "Development"
          }
        },
        "WebApplication1": {
          "commandName": "Project",
          "dotnetRunMessages": "true",
          "launchBrowser": true,
          "launchUrl": "swagger",
          "applicationUrl": "https://localhost:5001;http://localhost:5000",
          "environmentVariables": {
            "ASPNETCORE_ENVIRONMENT": "Development"
          }
        }
      }
    }
    

    ASPNETCORE_ENVIRONMENT--环境配置方式,默认为开发环境
    ASPNETCORE_ENVIRONMENT常见方式三种,也可进行自定义,例如Demo方式...

    //env.IsDevelopment 开发环境
    //env.IsProduction 生成环境
    //env.IsStaging 预览
    //env.IsEnvironment(demo) 可理解为自定义方式

    "ASPNETCORE_ENVIRONMENT": "Development"
    注:默认启动Startup.cs中
    public void ConfigureServices(IServiceCollection services)

    如果将"ASPNETCORE_ENVIRONMENT": "Demo"
    则启动——约定方式哦
    public void ConfigureDemoServices(IServiceCollection services)


    如下所示:

     注:如果找不到对应的ConfigureDemoServices,则启动ConfigureServices

      

    博客内容主要用于日常学习记录,内容比较随意,如有问题,还需谅解!!!
  • 相关阅读:
    web端常见兼容性问题整理
    浏览器初始化样式
    html5特效库
    csshack
    进程与线程,并发、并行、异步、多线程
    js复制粘贴事件
    dom range相关
    vue和react在使用上的对比
    ListView往TreView里面拖拽
    ListView添加项目带序列
  • 原文地址:https://www.cnblogs.com/YYkun/p/15581824.html
Copyright © 2020-2023  润新知