Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

IApplicationLifetime ApplicationStopping does not trigger if ConfigureServices method exists #151

@davidfowl

Description

@davidfowl

I spent a good few hours trying to track this down on mono and it seems like it happens on windows as well.

using System;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.Framework.DependencyInjection;

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {

    }

    public void Configure(IApplicationBuilder app, IApplicationLifetime lifetime)
    {
        lifetime.ApplicationStopping.Register(OnStuff);
    }

    public void OnStuff()
    {
        Console.WriteLine("Goodbye!");
    }
}

The above code will not print out goodbye.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions