|
Free
C# Tutorials
|
![]() |
home |
Stay
at Home and Learn
|
|||||
How to Run your C# Programmes |
||||||
|
You can test your programme a number of ways. First, though, it has to be built. This is when everything is checked to see if there are any errors. Try this:
The final line is this: Build: 1 succeeded or up-to-date, 0 failed, 0 skipped That's telling you that everything is OK. Now try this:
This time, you should see these two lines at the end of the report: Compile complete -- 1 errors, 0 warnings So it's telling you that it couldn't build your solution because there was 1 error. Put the semicolon back at the end of the line. Now click Debug from the menu at the top of Visual C# Express. From the Debug menu, select Start Debugging. You should see a black DOS window appear and then disappear. Your programme has run successfully! To actually see your line of text, click Debug > Start Without
Debugging. You should now see this:
And that's your programme! Have a look at the Solution Explorer on the right. Because the project has been built, you'll see two more files under Debug:
We now have a ConsoleApplication1.exe and ConsoleApplication1.pdb. The exe file is an executable programme, and it appears in the bin/debug folder. Switch back to Windows Explorer, if you still have it open. You'll see the exe file there:
You could, if you wanted, create a desktop shortcut to this exe file. When you double click the desktop shortcut, the programme will run. But that's enough of Console Applications - we'll move on to creating
Windows Applications.
<-- Your First Line of C# Code | Your First C# Windows Form --> <--Back to the C# .NET Contents Page View all our Home Study Computer Courses
|