Hi

I have just started C# (again) and written a small program. I have installed Microsoft Visual C# 2008 Express Edition. Now I want to compile and run my program but "start debugging (F5)" option is faded. Also I can't find any csc.exe file in the main directory where Visual C# 2008 is installed. Please help!

Thanks

Placing the files in the solution folder won't do anything, you have to
tell the solution to add new project/files. Chose File->Add Project-
>Existing Project and then browse to your individual project files (.csproj
files). You can also right click your solution name and Add->Existing
Items to add individual files in case you don't have a project.

I'm not quite sure what you are trying to do. You can put a whole bunch
projects in a single solution, but if you got more than one static void
Main() in the solution you won't be able to run it with F5/Ctrl-F5. You
can however compile a single project by right clicking the project name in
the solution explorer and choose Build.

If you have a bunch of files with static void Main() in several, comment
out the ones you don't want to run. F5/Ctrl-F5 will then work just fine
and will Compile, then run.

Thanks Mitja, Actually I am trying to compile .cs files (and not .csproj files or solutions). Sorry for not mentioning that in the very first post.

thanks ddanbe... That helped me in creating a batch file to compile my programs. Actually I found csc.exe in the following folder

C:\Windows\Microsoft.NET\Framework\v2.0.50727

(version number can vary from system to system)

Yeah it was and I was trying to find it under program files.

Lack of knowledge with intention of doing a search on the minimal data (only program files, not whole C drive) took so much time of ours. But good in a way that I got to learn things that I did not think of. Thanks to you and other who posted

So I just started Learning C# using the Sams Teach Yourself C# in 21 Days, first thing ti has you do after a bit of reading is, put this in your program u use to write the code,(I use Visual C# 2010 Express) I Started a new blank Project, set everything I need to windows app and added a Code file, typed int he code.

class Hello
{
    public static void Main()
    {
        System.Console.WriteLine("Hello, World!");
    }
} 

then pressed F5 it then made the folder and the bin folder ect ect for the .exe I had no errors, but when i click on the hello.exe it wont open.
And I don't get an error message it just thinks for a second then stops, and nothing.

Any Ideas on what I am doing wrong?

Edited 3 Years Ago by pyTony: fixed formatting

This question has already been answered. Start a new discussion instead.