Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Sunday, January 31, 2016 12:40 AM
I have created an Asp.Net 5.0, MVC 6 application using the empty template in Visual Studio 2015. I have the debugger set up to launch IIS express and use Chrome as the browser. In my project, I have added a Home controller, and a view for the Index action. I have also added _Layout.cshtml and _ViewStart.cshtml. I have the default code that has been automatically generated. The only changes I have made are to add and use MVC in the ConfigureServices() and Configure() methods in Startup.cs; and to list Microsoft.AspNet.Mvc as a dependency in Project.json file.
When I launch the debugger, nothing is sent to the browser even though I have a title in my index.cshtml page. When I pull up the F12 developer tools and look at the Console tab, it just says that an http 500 error has occurred on the server.
Where can I find more information about the server error?
The visual studio output window doesn't seem to have anything relevant. Is there a window in visual studio, or a log file in the OS where the actual server error is recorded? It used to be possible to debug the application_error handler in global asax file, which doesn't appear to be available in AspNet 5.0. Is there something similar to application_error?
I'm more interested in understanding the process of identifying HTTP 500 server errors when they occur, rather than fixing the particular error I have. I'm confident that when I can find out what the error is, I should be able to fix it.
All replies (4)
Monday, February 1, 2016 12:06 PM ✅Answered
Thanks for Viorel_'s help.
Hi Rob,
Maybe you can add error pages, view diagnostic information, or respond to requests with a simple welcome page by adding just one line to your app’s Startup.cs
class like this document here:
http://docs.asp.net/en/latest/fundamentals/diagnostics.html
A similar thread:
Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you.
Microsoft does not control these sites and has not tested any software or information found on these sites;
Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.
There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.
Thanks,
Jack
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.
Tuesday, February 2, 2016 10:48 PM ✅Answered
Thanks Jack.
The app.UseDeveloperExceptionPage() approach provides excellent exception and stack trace information on the developer exception page. This is a great first step. The next step will be to research if the same diagnostic information can somehow be captured quietly and logged in production and have the developer exception page replaced with a friendly but nondescript end user error page. The links you provided have given me a good starting point for my research.
So far it seems that neither the iis express log files, nor the trace files have anything of much use. But perhaps the full blown iis on my production server (Win 2012 r2) will have more. If not I will try to find a way to capture the information in code and use something like log4net to save it for trouble-shooting.
Any further suggestions would be welcome but this is definitely a good start.
Rob
Sunday, January 31, 2016 9:35 AM | 1 vote
Have you checked the log files? Usually they are located in IISExpress subfolder of your personal Documents folder.
Wednesday, February 3, 2016 5:14 AM
Hi Rob,
Thanks for your friendly response.
If any reply is helpful for you, you could mark it as the answer, so it would be helpful for other members who get the same issue.
In addition, capture the Exception or log messages was not the real solution for this kind of issue.
Since the real issue would be related to the Web development, if you could collect some logs or error messages, but still couldn't really resolve this issue, I suggest you post this issue to the ASP.NET forum http://forums.asp.netwhere asp.net experts live in. You could share a simple sample, main code or the detailed error message in your new thread, I think you would get dedicated support from the ASP.NET experts.
Sincerely,
Jack
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.