Last post Nov 05, 2019 01:20 AM by Rena Ni
Nov 01, 2019 11:33 PM|tinac99|LINK
I have an mvc application which do not go to the default page and goes to "page cannot be displayed" screen.
I already set the default in the following locations:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
// The default HSTS value is 30 days. You may want to change this for production scenarios, see
//app.UseHsts(); //commented 2019.10.28 for deployment purposes
//app.UseHttpsRedirection(); //commented 2019.10.28 for deployment purposes
OnPrepareResponse = context =>
context.Context.Response.Headers.Add("Cache-Control", "no-cache, no-store");
Application object -> Startup object -> Program
I appreciate your input!
Nov 03, 2019 11:33 AM|maherjendoubi|LINK
I could see a similar thread here
Nov 04, 2019 01:59 AM|Khuram.Shahzad|LINK
Are you debugging the application in visual studio and it is not going to Account->Login, if then what is response from browser 500 error or 404 or what?
You need to try it by CLI using dotnet run and it will show you actual issue with application., if there is any issue you will see there, another tip is create a logs folder in root of application and from web.config (after publish) enable logging and see
the result sometime i have seen if you have any dependencies error or any other sort of programming issue with initial controller then this happened.
try to comment the custom added code from startup files and then try it. you can also try to create another controller like home with simple index action and use
Nov 04, 2019 02:00 AM|Rena Ni|LINK
I could get into the default page successfully by using your code.Could you share more details that could reproduce your issue?
The reason for page cannot be displayed you could refer to:
Nov 04, 2019 07:01 PM|tinac99|LINK
It's a 404 error....
Nov 04, 2019 07:19 PM|mgebhard|LINK
It's a 404 error....
Perhaps you forgot an Area and the URL is /Identity/Account/login? Keep in mind that adding [Authorize] to the Home controller will cause a redirect to the Login page if you are using the default Identity configuration.
Nov 05, 2019 01:20 AM|Rena Ni|LINK
404 means the page not found,be sure your url is right.And your Controller and Action should be like below,no need to add `Route` attribute:
public class AccountController : Controller
public IActionResult Login()