开发者

Can I view debug level logging output in Visual Studio 2010 for my local running asp.net mvc 3 app?

I've been working with IntelliJ and Grails for the past year or so but am now on a Visual Studio 2010 and ASP.NET MVC 3 project. With the former, I get a console window with all kinds of debug information including SQL generated by GORM and stack traces as they happen with trivial configuration. Now, it's been a couple years since I've worked on an ASP.NET app (WebForms back then) but I don't remember anything like that in Visual Studio. Is there any way to view real-time debug logging output including LINQ-to-SQL generated statemen开发者_运维知识库ts, significant web server events (currently using the built-in development server), and stack traces when the occur?

Thanks.


AFAIK, you will depend on several tools to accomplish this task, take for example SQl-Profile to see the exact SQL queries as they run.

For web page events and real time performance statistics, you can rely on "ASP.NET Tracing"

this is from Microsoft Official documentation :

If you want trace information to appear at the end of the page that it is associated with, set the trace element's pageOutput attribute to true. If you want tracing information to be displayed only in the trace viewer, set the pageOutput attribute to false.

By adding the following block of code to your web.config, you will be able to see many performance statistics that you will enjoy looking at.

<configuration>
  <system.web>
    <trace enabled="true" pageOutput="true" requestLimit="40" localOnly="false"/>
  </system.web>
</configuration>

this will append real-time tracing information at the end of every page you visit.

For debugging information, you can give Intelli-Trace a try.

it's a VS2010 new feature that allows you to collect debugging information while you use the website, this may describe it better than me:

IntelliTrace collects data about a managed application in the background, including information from many framework components such as ADO.NET, ASP.NET and System.XML. These IntelliTrace events allow the developer to see what has previously occurred during execution, and most importantly, to “step back in time” to see prior states of the application without having to restart the debugger.

Feel free to let me know if you need anything else, thanks. and don't forget to mark as answer if this helped you, appreciate it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜