Monday, February 1, 2010

Creating a C# app using Visual Studio.NET...

        Its quiet simple creating and executing a C# app using VS.NET. I reckon one of the major reasons behind this is its user friendly GUI and the other reasons may be like intellisense, pre-written lines of code, code snippets and so on......

        To start writing a C# app we need to do the following:
Open VS.NET-->File menu-->new project-->choosing a template (as if now console app); choosing a framework version we want to work with-->click ok. As soon as we click ok, the created file will be opened and within the file we will find the following:

1.The set of namespaces that are frequently used and that are imported using 'using' statement.
2.Current project's namespace which is created automatically.
3.Current Class under the current project's namespace and a Main() under the current class, which are also created automatically.

        So now we can directly write our code for C# app within the Main() of the current class as following:   Console.WriteLine("first C# app");

        Now we can run the current C# app by using Debug option which will build and then run the C# app. To debug we need to press F5 or ctrl+F5. This will output the result in a console window.


        I think its quiet evident how VS.NET makes the development of a .NET app so simple. Instead of writing 8 lines of code we just wrote a single line of code and it (single line of code) can be executed by pressing a single key (F5).