+ Request ID: @Model.RequestId
+
+ Swapping to the Development environment displays detailed information about the error that occurred. +
++ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +
diff --git a/tests/Agent/IntegrationTests/Applications/BasicAspNetCoreRazorApplication/Pages/Error.cshtml.cs b/tests/Agent/IntegrationTests/Applications/BasicAspNetCoreRazorApplication/Pages/Error.cshtml.cs new file mode 100644 index 0000000000..f3138e1dea --- /dev/null +++ b/tests/Agent/IntegrationTests/Applications/BasicAspNetCoreRazorApplication/Pages/Error.cshtml.cs @@ -0,0 +1,30 @@ +// Copyright 2020 New Relic, Inc. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +using System.Diagnostics; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace BasicAspNetCoreRazorApplication.Pages +{ + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + [IgnoreAntiforgeryToken] + public class ErrorModel : PageModel + { + public string RequestId { get; set; } + + public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + + private readonly ILoggerLearn about building Web apps with ASP.NET Core.
+Static is as static does.
+ + diff --git a/tests/Agent/IntegrationTests/Applications/BasicAspWebService/BasicAspWebService.csproj b/tests/Agent/IntegrationTests/Applications/BasicAspWebService/BasicAspWebService.csproj index df7480be02..0b5632d1be 100644 --- a/tests/Agent/IntegrationTests/Applications/BasicAspWebService/BasicAspWebService.csproj +++ b/tests/Agent/IntegrationTests/Applications/BasicAspWebService/BasicAspWebService.csproj @@ -86,7 +86,7 @@