Upgrading an ASP.NET 5 MVC app from beta4 to beta5

ASP.NET 5 Beta 5 is out now, so go get it. The only thing that really broke for me was my custom configuration source setup.

//beta4
public Startup(IHostingEnvironment env)
{
    // Setup configuration sources.
    Configuration = new Configuration()
                        .AddJsonFile("secret.json");
                        
}

//beta5
public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv)
{
// Setup configuration sources.
Configuration = new Configuration(appEnv.ApplicationBasePath)
.AddJsonFile("secret.json");
}

I also use this for my integration tests. In this case you could do something like this:

IConfiguration config = 
    new Configuration(Directory.GetCurrentDirectory())
    .AddJsonFile("secret.json");

Copyright 1998 - 2022 F. Hötzinger Klingerfeldstr. 2a 94550 Künzing
Mail: florian@hoetzinger.de | Twitter: @3dshootercom | Mastodon: @hoetz@dotnet.social