logo
  • 教程列表
  • SO官方文檔
  • 配置多個環境
    • 為每個環境提供 appsettings
    • 來自程式碼的 GetCheck 環境名稱
    • 配置多個環境
    • 在檢視中呈現環境特定內容
    • 從命令列設定環境變數
    • 從 PowerShell 設定環境變數
    • 從 web.config 使用 ASPNETCORE ENVIRONMENT
  1. StackOverflow 文件
  2. asp.net-core 教程
  3. 配置多個環境
  4. 從 PowerShell 設定環境變數

從 PowerShell 設定環境變數

Created: November-22, 2018

使用 PowerShell 時,可以使用 setx.exe 永久設定環境變數。

  1. 啟動 PowerShell

  2. 鍵入以下內容之一:

    setx ASPNETCORE_ENVIRONMENT開發

    setx ASPNETCORE_ENVIRONMENTstaging

  3. 重新啟動 PowerShell

  • 從 web.config 使用 ASPNETCORE ENVIRONMENT
  • 從命令列設定環境變數

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明