Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working with multiple environments #10

Closed
venux opened this issue Aug 29, 2017 · 0 comments
Closed

Working with multiple environments #10

venux opened this issue Aug 29, 2017 · 0 comments
Labels

Comments

@venux
Copy link
Owner

venux commented Aug 29, 2017

多环境工作

ASPNETCORE_ENVIRONMENT 环境变量

  • Development 开发环境

  • Staging 预发布、部署上线前的最终测试环境、生产环境的物理镜像

  • Production 生产环境(安全性、高性能、稳健性)

    • 开启缓存
    • 客户端资源 bundledminifiedCDN
    • 关闭 diagnostic ErrorPages
    • 开启 friendly error pages
    • 开启 production loggingmonitoring
    • ...

注:

  • Windows 不区分大小写,Linux 默认区分大小写。

  • 设置:右键项目属性-调试-环境变量,另在 ~\Properties\launchSettings.json 可看到具体配置。

    • launchSettings.json 存储的变量可访问到,不安全,禁止存放加密信息,使用 Secret Manager 存放加密信息。
  • 本机设置

    • 临时:set ASPNETCORE_ENVIRONMENT=Development
    • 永久:环境变量-ASPNETCORE_ENVIRONMENT=Development
@venux venux added the .NET label Aug 29, 2017
@venux venux closed this as completed Sep 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant