官术网_书友最值得收藏!

Different startups for different environments

Applications run in different environments, such as development, staging, and deployment:

  • Development environment: Where developers run their freshly written code; this is usually their own machine.
  • Staging environment: An environment similar to the production environment, but not open to the public. Used to test the application on similar conditions as the production environment.
  • Production environment: Where the application runs publicly, usually on the cloud or a hosting company.

Every environment has a different set of configurations — for example, in development, logging will be set to verbose mode, meaning that all logs should be written, while in production, logging will be set to warning mode, so only warnings and errors will be logged.

ASP.NET Core supports supplying different Startup classes for each environment. To do this, you can create different classes with names following the convention of Startup{Environment Name}. For example, StartupDevelopment will run under the development environment and StatupProduction will run under the production environment.

The current environment is set via the ASPNETCORE_ENVIRONMENT environment variable, which you can change based on the environment you run on - Development, Testing, Production and so on.

主站蜘蛛池模板: 祥云县| 菏泽市| 呼图壁县| 柯坪县| 和平区| 大城县| 炎陵县| 长岛县| 土默特右旗| 竹溪县| 宿迁市| 温宿县| 上林县| 峡江县| 瑞安市| 石泉县| 闽侯县| 武鸣县| 鄯善县| 池州市| 桐城市| 石门县| 格尔木市| 永仁县| 建德市| 久治县| 兴国县| 股票| 霍州市| 朔州市| 顺义区| 高台县| 丹寨县| 南康市| 池州市| 门源| 红原县| 旬阳县| 民乐县| 大竹县| 花垣县|