9
votes

I'm following Scott Allen's Asp.Net core Pluralsight course in Ubuntu 16.04 .Net Core 1.0.0 framework. I'm unable to find the app.UseRuntimeInfoPage method in Configure method in StartUp.cs file, even though I have included Microsoft.AspNetCore.Diagnostics. Does the framework have limitations for the non-windows operating systems in terms of the features provided?

StartUp.cs code from Scott Allen's course

using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Configuration;
using OdeToFood.Services;

namespace OdeToFood
{
    public class Startup
    {
        public Startup()
        {
            var builder = new ConfigurationBuilder()
                            .AddJsonFile("appsettings.json");
            Configuration = builder.Build();
        }

        public IConfiguration Configuration { get; set; }

        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();
            services.AddSingleton(provider => Configuration);
            services.AddSingleton<IGreeter, Greeter>();
        }

        // This method gets called by the runtime. 
        // Use this method to configure the HTTP request pipeline.
        public void Configure(
            IApplicationBuilder app,
            IHostingEnvironment environment,
            IGreeter greeter)
        {
            app.UseIISPlatformHandler();

            if (environment.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            
            app.UseRuntimeInfoPage("/info");

            app.UseFileServer();

            app.UseMvcWithDefaultRoute();

            app.Run(async (context) =>
            {
                var greeting = greeter.GetGreeting();
                await context.Response.WriteAsync(greeting);
            });

        }

        // Entry point for the application.
        public static void Main(string[] args) => WebApplication.Run<Startup>(args);
    }
}
1

1 Answers

9
votes

This feature was removed some time ago. https://github.com/aspnet/Home/issues/1632

Also, it seems like it is scheduled to come back at an undetermined moment in time. https://github.com/aspnet/Diagnostics/issues/280

So for now you can remove it from your startup.cs; or add the code and create your own version of it from this commit: https://github.com/aspnet/Diagnostics/commit/af19899927516718bdc05507612dcc17901fb937

I do not provide a code sample because the code is in the commit mentioned above.

UPDATE:

It seems like issue #280 has been updated to state that the feature will not be brought back at all.