B CUSP 110B – Digital Thinking

Visual Studio IDE: FAQ and Help

 

 

 

Here are the links to questions/answers in this document:

·         Which IDE should I run, what is an IDE?

·         How do I open a project? After I double clicked on .sln nothing happens?!

·         How can I find the source code in my project? Solution Explorer and ClassExample.cs file?

·         How do I compile and run?

·         Why can’t I run? “But my green button is greyed out!?”

·         Why can’t I edit? When I try type, I got a pop-up window with error …   

·         How can I see line number in my editor?

·         Help! I am stuck after my program encounters an error! When I run my program, nothing happens and I saw an error window popped up …

 

 

 

 

Question: Which IDE? What is the difference between Microsoft Visual Studio 2010 (the one we use in the lab,), and Microsoft Visual C# Express 2010 (the one you download at home ()?

Answer:  One costs money (), and how lot more powerful, while the other one is free () and has a smaller set of functionality. They are the same as far as we are concerned. We will refer to both/either as Visual Studio, or just VS.

Back to top of page.

 

 

Question: Open the project? After I double click on my ClassExample.sln nothing happens?

Answer:  This can sometimes happen when Windows is confused as to which version of VS to start. Do this: start the VS first, and then open the ClassExample.sln file from within VS:

 

·         Start VS: (either Visual Studio 2010, or Visual C# 2010 Express) will do.

 

·         After VS is running, open your ClassExample.sln as a project file:

·        

 

Back to top of page.

 

 

 

Question: Solution Explorer and the Source code file (ClassExample.cs)? After I open my ClassExample.sln, this is what I see:

 

There is no source code or file listings on the right!? What do I do?

 

Answer:  The “file listing” on the right is referred to as the “Solution Explorer”, you can always bring up the Solution Explorer by:

 

·         Either: click on the red-highlight button below:

·         Or: under ViewàSolution Explorer:


·         Now you will see the Solution Explorer:

·         Double click on “ClassExample.cs” to bring up the source code:


Back to top of page.

 

Question: Compile and run? How do I compile and run my program?

Answer:  There are two ways:

 

·         First way: click on the red-highlight button in green:

·         Second way: under DebugàStart Debugging:


·         When your program starts to run, you will see something like:

This is the window of your running program, or, the Program Window.


Back to top of page.

 

Question: Cannot run/debug? BUT my “button in green” is greyed-out and my Debug Menu look different?

Answer:  If your “button in green” is grey-out, and/or your Debug menu looks like:

 

·         Grey-out button in green:

·         Or Debug menu looks like (no “Start Debugging” item):


·         You can tell if your program is already running by checking out the “lock” icon besides your source code

If you are seeing the above cases, then, your program is already running. Go your Program Window.


Back to top of page.

 

Question: Cannot edit? BUT When I try to edit ClassExample.cs, I got a pop-up window that says:

 

Changes are not allowed while code is running or if the option …

What is going on?

Answer:  You are probably seeing a pop-up that looks like this:

 

This message tells you that your program is already running, you cannot edit the source file when your program is currently running. You must find and close your current running Program Window before you will be able to edit again.


Back to top of page.

 

Question: Get line number to show up in editor? How can I get line number to show up in my VS editor?

Answer:  Do this:

·         Tools à Options:

·         In Options Window: Enable “Show All Settings”

·         In Options Window: Text Editor à All Languages à General
 

Back to top of page.

 

Question: Got stuck after error? When I run my program nothing happens and I saw An error message box (that probably looks something like the following):

 

Answer:  this is Visual Studio’s way of telling something is wrong with your program, (in this case, you are using myCircle before actually creating (using before the new command). You need to tell VS to go back to the editor so you can edit your source code to correct the mistake.

 

·         Close the error window by clicking on the “X” of the error window:

·         Tell VS to stop running/debugging: at this point VS is still trying to figure out what is going, and you need to tell it to STOP, here is how:

o   Debug è Stop Debugging

Back to top of page.