ASP.NET Core Tutorial – Session 6 – Environment variable & Hosting Environment
We allocate this session of ASP.NET Core tutorial to introduce Environment variable and Hosting Envirionment. During this session, we explain about the location and the way of creating Environment Variable. Also, we talk about popular Hosting Environment and go through details of its conditions.
Environment Variable
Environment Variable could be created or edited in launchSettings.json file(we have introduced tis file in session five), operation system or web server. Below you can see the source code of launchSettings.json. The related section has been highlighted. This variable implies the stage of Hosting Environment. It is possible to create an Environment Variable for each launcher profile.
We can also create an Environment Variable in operation system. Bear in mind, if the web server or launchSettings.json file would not be determined at the time of application deployment, the default amount of application safety on operation system or web server would be production. On Windows operation system, we can set this variable from this path: System Properties-Environment Variable. It is completely explained in our video.
Moreover we can create and set Environment Variable on web server. For example in IIS, we have this option in Configuration Editor section of application in system.webServer/aspNetCore. We explain about it in our video.
Value of this Environment Variable can be accessible through Startup Class and Configure method. This method has two parameters that one of them is IWebHostEnvironment and its name is env. Via this parameter we can have access to Environment Variables. Below code explains this matter.
Hosting Environment
Generally, development teams and company separate each development process to three different stages. Development, Staging and Production.
Development Hosting Environment
This stage is for daily application or website development, development team implement their codes and do troubleshooting and debugging during this stage. In development stage we upload none minified CSS and JavaScript files. Also in case of exception, application shows Developer Exception Page that contains technical information which help developer to debug the code.
Staging Hosting Environment
Application or website should be as much as possible same as final production. During this stage we check ant possible deployment issue. Also, we still upload none minified CSS and JavaScript file, but application in case of exception will show user friendly exception page that contains generic message and encourage users to report the problem to site admin or development team. Moreover, during this stage developer team does not do code troubleshooting and debugging.
Production Hosting Environment
This stage is for presenting final production to be used for daily business. We upload minified CSS and JavaScript file in this stage for more security and performance. Moreover, in case of exception, application shows a user friendly page and we should not show developer exception page in this stage. Because, first of all those information are not understandable for users and malicious user can use those information to hack our application.
Tutorial Playlist
https://bit.ly/3lxQP9n
Our Social Media
Facebook: https://bit.ly/310ksqA
Instagram: https://bit.ly/3cOq4th
Telegram: https://bit.ly/3s4mzWc
Text Version of course:
https://www.goldencourses.net/asp-net-environment-variable-hosting-environment/
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «ASP.NET Core Tutorial – Session 6 – Environment variable & Hosting Environment», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.