Debug C# code without running the application

c#, debugging, visual-studio-2010

Solution

I use linqpad http://www.linqpad.net/ for quick testing of c# code.

Problem

I'm often in the need of debugging/testing my code or a small part of it. One way to go is of course to run the application I am developing, or when developing a class library creating a small test application. Another way is to create a unit test just for debugging purpose and run it in Visual Studio. But what if when I don't want to write additional code (like disposable unit tests) and I don't want to start the whole application (takes some time to start and to navigate to the code I want to debug)? Is there a way to run a small portion of code in Visual Stuio respectively interpret C# code? EDIT I know about LINQPad. But sometimes I want to know e.g. how an `Form` looks like while running or if a component is able to talk to a database. So LINQPad does not suit my needs in those cases...

Original source

Related problems