Skip to content

Instantly share code, notes, and snippets.

View johnkors's full-sized avatar

John Korsnes johnkors

View GitHub Profile
@johnkors
johnkors / CustomHandleErrorAttribute.cs
Created January 15, 2016 14:21 — forked from lkaczanowski/CustomHandleErrorAttribute.cs
Custom ASP.NET MVC handle error attribute. Handles and logs all errors.
public class CustomHandleErrorAttribute : HandleErrorAttribute
{
private static readonly ILog _log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public override void OnException(ExceptionContext filterContext)
{
_log.Error("Internal server error occurred while handling web request.", filterContext.Exception);
if (!filterContext.HttpContext.IsCustomErrorEnabled)
{
return;
## Octopus Azure deployment script, version 1.0
## --------------------------------------------------------------------------------------
##
## This script is used to control how we deploy packages to Windows Azure.
##
## When the script is run, the correct Azure subscription will ALREADY be selected,
## and we'll have loaded the neccessary management certificates. The Azure PowerShell module
## will also be loaded.
##
## If you want to customize the Azure deployment process, simply copy this script into
## Octopus Azure deployment script, version 1.0
## --------------------------------------------------------------------------------------
##
## This script is used to control how we deploy packages to Windows Azure.
##
## When the script is run, the correct Azure subscription will ALREADY be selected,
## and we'll have loaded the neccessary management certificates. The Azure PowerShell module
## will also be loaded.
##
## If you want to customize the Azure deployment process, simply copy this script into
using System;
using System.Net.Http;
using System.Web.Http.Controllers;
using System.Web.Http.Dispatcher;
using Ninject;
namespace WebApiNinjectIHttpControllerActivator
{
public class NinjectKernelActivator: IHttpControllerActivator
{