Skip to content

ErrorPageOptions in beta6 #861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
manfredk opened this issue Aug 24, 2015 · 4 comments
Closed

ErrorPageOptions in beta6 #861

manfredk opened this issue Aug 24, 2015 · 4 comments
Labels

Comments

@manfredk
Copy link

After updating the ASP.Net5 WebApp project template to beta6 I have the following issue in Startup.cs:

app.UseErrorPage(ErrorPageOptions.ShowAll);

This line throws 'ErrorPageOptions' does not contain a definition for 'ShowAll'. Any idea, how this is handled in beta6?

@manfredk
Copy link
Author

ErrorPageOptions still live in Diagnostics, so I checked it in Object Viewer but couldn't find "ShowAll".

After reading the intellisense description I solved the problem with:

app.Properties["host.AppMode"] = "development";
app.UseErrorPage();

This worked and seems to be the way to show all errors in beta6.

@Tratcher
Copy link
Member

Correct, most of the configuration was removed from EPO. Note you don't need the app.Properties["host.AppMode"] = "development"; line either, that looks like legacy from Katana. To conditionally include the middleware do something like this:

        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            // Add the following to the request pipeline only in development environment.
            if (env.IsDevelopment())
            {
                app.UseErrorPage();
            }
            else
            {
                // Add Error handling middleware which catches all application specific errors and
                // sends the request to the following path or controller action.
                app.UseErrorHandler("/Home/Error");
            }
// ...

@henkmollema
Copy link
Contributor

You used to be able to configure which parts of the error page you wanted to show with ErrorPageOptions. That has been removed since beta6 and we just show everything by default. The only thing can configure now is the amount of lines of source code before and after the line of code in the exception's stack frame. You can remove the ErrorPageOptions.ShowAll as stated above.

@manfredk
Copy link
Author

thx for the clarification, very helpful.

natemcmaster pushed a commit that referenced this issue Nov 14, 2018
- Also renamed ServerAddressFacts to ServerAddressTests to match existing test classes
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants