I’m from Java to C# these days, and using Visual C# 2010 express.
Sometimes I want to write and test some simple code, but I found it not as easy as in Eclipse: write a main method in any java file, and run it.
In VC#, when I add a Main method in a .cs file, it will notice me there are two Main entry in this project. I have to rename the other one before running, and have to rename it back later.
Is there an easy way to do this?
Visual Studio works better for large projects. If you just want to test some code then I’d either stick it in the main method of your application, or forget VS and run it through a code scratchpad.
The best C# code scratchpad out there is LINQPad
Of course, if you’re testing a lot you may need to stub out any dependencies that the code has. It’s difficult to say without knowing the scope of your code, or the type of project.