I'm doing an exercise from a book, where I created a project called "Example.cs".
When I wrote the code, here are the steps involve:
1. Select New Item. This causes the Add New Item dialog to be displayed. Select Code File and then change the name to Example.cs,

2.Next, add the file to the project by pressing Add.

3. Next, type the example program into the Example.cs window and then save the file

4. Compile the program by selecting Build Solution from the Build menu.

5. Run the program by selecting Start Without Debugging from the Debug menu.

This is no problem until here. And below of the examples there is a note written like this:
As the preceding instructions show, compiling short sample programs using the IDE involves a number of steps. However, you don’t need to create a new project for each example program in this book. Instead, you can use the same C# project. Just delete the
current source file and add the new file. Then recompile and run.

What does the "Just delete the current source file and add the new file" mean here? How can I do that?
Does that mean, I have to delete the code that I've wrote and rename the Example.cs and do the next exercise?

Thank you

9 Years
Discussion Span
Last Post by Ramy Mahrous

Or delete the Example.cs and repeat the steps to create new code file and paste the code into. Or simply replace existing code with new one.
Actually this is bad comment, ignore it!


hi Ramy
thanks for the comment. So what I did is, I commented the old examples and just rename the class and add another example.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.