惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
V
Visual Studio Blog
宝玉的分享
宝玉的分享
IT之家
IT之家
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
I
InfoQ
B
Blog RSS Feed
T
Threatpost
博客园_首页
M
MIT News - Artificial intelligence
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Know Your Adversary
Know Your Adversary
U
Unit 42
Engineering at Meta
Engineering at Meta
C
Cyber Attacks, Cyber Crime and Cyber Security
月光博客
月光博客
Scott Helme
Scott Helme
T
Tor Project blog
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
S
Schneier on Security
Vercel News
Vercel News
博客园 - Franky
C
Cybersecurity and Infrastructure Security Agency CISA
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
L
LangChain Blog
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
The GitHub Blog
The GitHub Blog
雷峰网
雷峰网
Latest news
Latest news
C
CXSECURITY Database RSS Feed - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
G
GRAHAM CLULEY
S
Security Affairs
A
About on SuperTechFans
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
大猫的无限游戏
大猫的无限游戏
W
WeLiveSecurity
Cisco Talos Blog
Cisco Talos Blog
罗磊的独立博客

博客园 - 宁静致远.

Swagger 页面登录验证中间件(Basic认证) Hangfire 的 ASP.NET Core 应用程序始终运行在IIS上 DevExpress 无法打开WinForm设计窗体,报错: 类型 universe 无法解析程序集: System, Version=2.0.0.0 PowerDesigner参数设置 Hangfire 任务调度配置 雪花漂移ID,Yitter.IdGenerator 封装成一个适用于 ASP.NET Core 6.0 的服务组件 解决 Hangfire 中使用HttpClient 任务超时问题 TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing. ASP.NET Core API 自定义全局异常 Dapper模糊查询Like 删除重复记录,仅留一条 Task 多线程执行 使用Hangfire+.NET 6实现定时任务管理(推荐) 使用 IHttpClientFactory 处理请求和响应 Json 序列化,将对象序列化为Json字符串(此Json序列化,是“不安全的放松JSON转义”,即不会将物特殊符号和中文进行转码) 查询指定数据库中有全部表名,快速定位列名所在表 Sql 查询工具 Sql 数据库表查询 Json 列 显示实体之间的外键关系 调整PowerDesigner各种字体大小 工厂里常说的QC, IQC,IPQC,QA都是干什么的?
appsettings.json launchSettings.json 发布 配置
宁静致远. · 2024-11-11 · via 博客园 - 宁静致远.

默认的 JsonConfigurationProvider 会按以下顺序加载配置:

  1. appsettings.json
  2. appsettings.{Environment}.json:例如,appsettings.Production.json 和 appsettings.Development.json 文件。 文件的环境版本是根据 IHostingEnvironment.EnvironmentName 加载的。 有关详细信息,请参阅在 ASP.NET Core 中使用多个环境

appsettings.{Environment}.json 值替代 appsettings.json 中的键。 例如,默认情况下:

  • 在开发环境中,appsettings.Development.json 配置会覆盖在 appsettings.json 中找到的值。
  • 在生产环境中,appsettings.Production.json 配置会覆盖在 appsettings.json 中找到的值。 例如,在将应用部署到 Azure 时。

commandName 的值可指定要启动的 Web 服务器。 commandName 可为以下任一项:

  • IISExpress:启动 IIS Express。
  • IIS:不启动任何 Web 服务器。 IIS 预计可用。
  • Project:启动 Kestrel。

IHostEnvironment.EnvironmentName 可以设置为任意值,但是框架提供了下列值:

----------------------------------------------------------------

配置文件:Properties\launchSettings.json 

{
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "APS.Web": {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "http://localhost:57679/"
    },
    "Production.APS.Web": {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Production"
      },
      "applicationUrl": "http://localhost:57679/"
    },
    "Staging.APS.Web": {
      "commandName": "Project",
        "environmentVariables": {
            "ASPNETCORE_ENVIRONMENT": "Staging"
        },
      "applicationUrl": "http://localhost:57680/"
    }
  },
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:57678/",
      "sslPort": 0
    }
  }
}

——————————————————————————————

发布文件:Properties\PublishProfiles\StagingFolderProfile.pubxml

<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
  <PropertyGroup>
    <DeleteExistingFiles>true</DeleteExistingFiles>
    <ExcludeApp_Data>false</ExcludeApp_Data>
    <LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <PublishProvider>FileSystem</PublishProvider>
    <PublishUrl>bin\Release\net6.0\TestPublish</PublishUrl>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <_TargetId>Folder</_TargetId>
    <SiteUrlToLaunchAfterPublish />
    <TargetFramework>net6.0</TargetFramework>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <ProjectGuid>13ebc7c8-5427-42f4-bd87-e3b231b23d7b</ProjectGuid>
    <SelfContained>false</SelfContained>
      <EnvironmentName>Staging</EnvironmentName>
  </PropertyGroup>
</Project>

 特别注意:非 生产环境(Production),必须在发布文件中设置:<EnvironmentName>Staging</EnvironmentName> ,环境名称,否则始终默认为:Production

 参考:https://zhuanlan.zhihu.com/p/575487681