简体   繁体   English

Visual Studio ASP.NET的错误/访问日志

[英]Error/Access log of visual studio asp.net

I'm very new to C# and ASP.NET for web development. 我对C#和ASP.NET进行Web开发非常陌生。 I am using Visual studio. 我正在使用Visual Studio。 I built a small web application with one html page that sends a request (using angularJS) to a function in my ApiController. 我用一个HTML页面构建了一个小型Web应用程序,该页面向ApiController中的函数发送请求(使用angularJS)。 It returns with error 500. (I see it in inspect elements of my browser). 它返回错误500。(我在浏览器的inspect元素中看到它)。

I want to know more information about the error but I can't see anything in the output panel of visual studio. 我想了解有关该错误的更多信息,但在Visual Studio的输出面板中看不到任何内容。

I have some experience in Django+Python in PyCharm and I expect to see something like PyCharm terminal showing all the requests hitting server, and possible internal errors. 我在PyCharm中的Django + Python方面有一些经验,我希望看到类似PyCharm终端的内容,其中显示了所有访问服务器的请求以及可能的内部错误。

Can someone help with where can I find this kind of info please? 有人可以帮我在哪里找到这种信息? (I know it's a very basic question but that's how beginner I am in visual studio) (我知道这是一个非常基本的问题,但这就是我在Visual Studio中的初学者情况)

Some options you may have with VS is Break On All Errors ,Enable Logging with Logging provider. VS可能具有的一些选项是“所有错误均会中断” ,“使用日志记录提供程序启用日志记录”。

Break On All Errors 打破所有错误

In Visual Studio press Alt+Ctrl+E .It will show exception settings windows.Tick the common language run time exceptions.When you tick it, it will break the execution when ever exception throws.At development environment i find this most helpful than out put window and logging. 在Visual Studio中按Alt + Ctrl + E。它将显示异常设置窗口。勾选公共语言运行时异常。当您勾选它时,它将在异常抛出时中断执行。在开发环境中,我发现这最有用放置窗口并记录日志。

When code breaks have a look at details and the call stack to get bigger idea about what is happening. 当代码中断时,请查看详细信息和调用堆栈,以更全面地了解正在发生的事情。

VS的例外设置窗口

Enable Logging with Logging Provider 使用日志记录提供程序启用日志记录

Use some logging provider like NLog and configure logging.But in this case you need to write to the log.Again for production environment you really need those logs. 使用诸如NLog之类的日志记录提供程序并配置日志记录,但是在这种情况下,您需要写入日志。再次针对生产环境,您确实需要这些日志。 Further if you are using Asp.Net Core logging with asp net core tutorial may help you. 此外,如果您将Asp.Net Core 日志记录与ASP Net Core教程一起使用,则可能会对您有所帮助。

In addition to that use a web debugging proxy like fiddler .Something like that becomes very useful when it comes to inspecting requests in apis. 除此之外,还可以使用诸如fiddler之类的Web调试代理。在检查api中的请求时,类似的东西将变得非常有用。

Other than those you can use breakpoints,immediate window,call stack and watch window. 除了这些以外,您还可以使用断点,立即窗口,调用堆栈和监视窗口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2012 ASP.NET Webadminfiles错误 - Visual studio 2012 ASP.NET webadminfiles error 自定义404错误消息ASP.NET Visual Studio - Custom 404 Error Messages ASP.NET Visual Studio Visual Studio 2012中“ /”应用程序中的ASP.NET服务器错误 - ASP.NET Server Error in '/' Application in Visual Studio 2012 Asp.net Visual Studio及时调试器错误 - Asp.net visual studio just in time debugger error visual studio 2012 asp.net HTTPpost数据到db错误 - visual studio 2012 asp.net HTTPpost data to db error 在Visual Studio中运行Asp.NET项目时出现数据库错误 - DataBase Error while running Asp.NET project in Visual Studio 如何在Visual Studio 2012上使用ASP.NET(包含MVC)C#配置或设置Log4Net - How to configure or setup Log4Net with ASP.NET ( included MVC) C# on Visual Studio 2012 ~ ~ Visual Studio-独立的Asp.net项目 - Visual studio - Separate asp.net projects Visual Studio Visual Studio MVC asp.NET Google Map - Visual Studio Visual Studio MVC asp.NET Google Map 从asp.net应用程序访问网络共享。 在Visual Studio中工作,但在IIS中工作,为什么? - Access a network share from an asp.net app. Works in Visual Studio but not in IIS, why?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM