Vault of Thoughts

2006-07-19

Please visit my new blog at vaultofthoughts.net

Debugging with immediate window

Sometimes you really need to debug some part of the application but you don't want to start it. For example you want to debug some lower layer of the application and the startup time takes too long. There is a quick solution for this problem. You can use the Immediate Window from Visual Studio to start a debug session. Just type a class name (with namespace) and a method name you want to call if it is static. Otherwise you have to add a call to constructor in a form of "new" keyword. Just remember to put a breakpoint somewhere :-)


As far as I know this window is not available by default so use Debug/Widnows/Immediate to show it.


The sad thing is that it does not work for an ASP.NET project, but other than that you can use it not only for testing your own methods, but to call methods of the built in classes such as System.DateTime.Now.

If you liked this article why not support its author by making a donation?

1 Comments:

  • You can also use the "Find In Files" texbox that is usually always available and write:
    >? System.DateTime.Now

    You have to write ">" first to execute a method. You can also open a file:
    >open myfile.cpp

    By Anonymous Anonymous, at 6:15 PM  

Post a Comment

Links to this post:

Create a Link

<< Home