Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/s-a/env.net
.NET environment configuration
https://github.com/s-a/env.net
Last synced: about 7 hours ago
JSON representation
.NET environment configuration
- Host: GitHub
- URL: https://github.com/s-a/env.net
- Owner: s-a
- License: other
- Created: 2015-09-27T18:25:16.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-28T18:46:34.000Z (about 9 years ago)
- Last Synced: 2024-04-14T22:49:08.806Z (7 months ago)
- Language: C#
- Size: 148 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Multiple Environment Support For .NET WebApplications
ASP.NET 5 introduces improved support for controlling application behavior across multiple environments, such as development, staging, and production. See http://docs.asp.net/en/beta5/fundamentals/environments.html for more informations. This assembly aims to give support for such multiple environments for ASP.NET before version 5.
## Development
This should be the environment used when developing an application.
## Staging
Pre-production environment used for final testing before deployment to production. Ideally, its physical characteristics should mirror that of production, so that any issues that may arise in production occur first in the staging environment, where they can be addressed without impact to users.## Production
The Production environment is the environment in which the application runs when it is live and being used by end users. This environment should be configured to maximize security, performance, and application robustness. Some common settings that a production environment might have that would differ from development include:- Turn on caching
- Ensure all client-side resources are bundled, minified, and potentially served from a CDN
- Turn off diagnostic ErrorPages
- Turn on friendly error pages
- Enable production logging and monitoring (e.g. AppInsights)## Global.asax
```c#
<%@ Application Language="VB" %>Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs on application startup
Dim i As env.net.WebConfig = New env.net.WebConfig()
i.patch()
End SubSub Application_End(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs on application shutdown
End SubSub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when an unhandled error occurs
End SubSub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when a new session is started
End SubSub Session_End(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when a session ends.
' Note: The Session_End event is raised only when the sessionstate mode
' is set to InProc in the Web.config file. If session mode is set to StateServer
' or SQLServer, the event is not raised.
End Sub```