Tips n Tracks

  • Increase font size
  • Default font size
  • Decrease font size
  • default color
  • black color

Reference

Sample image

Microsoft .NET Framework Get Details.

Sample image

Microsoft .NET Framework Get Details.

Reference

Sample image Microsoft .NET Framework Get Details.
Sample image

Microsoft .NET Framework Get Details.


How to Get a Free C# Command Line Compiler


How to Get a Free C# Command Line Compiler

When you buy Visual Studio 2005, you get the full-featured integrated development environment (IDE). If you don’t have Visual Studio 2005, You can also get a free C# compiler by using one of the following options:
You can get the command-line compiler (csc.exe) from Microsoft site

http://msdn2.microsoft.com/en-us/netframework/aa731542.aspx.
Download the redistributable package of the .NET Framework, which includes the compiler and the .NET Framework with C# 2005 syntax support.

Compiling with the compiler comes with the .NET Framework.

If you downloaded the C# command-line compiler only, you must include it in the path before using it. Do this by adding the location of the compiler to the PATH variable in the Windows environment. The compiler is located in the following
directory:
%windir%\Microsoft.NET\Framework\<version>
where:
%windir% is the environment variable that indicates the location of the Windows directory. If you are using Windows XP, this variable is replaced by C:\WINDOWS.
<version> is the version of the .NET Framework. The latest version is v3.0 and 3.5 beta 2 also available, the location will be "%windir%\Microsoft.NET\Framework\<version>"
To add the location of the compiler to the path, use the following steps:
press window’s button + R Run… Dialog box will appear then run “cmd” you will get Command Prompt
When the Command Prompt window opens,if not on root directory type cd\ and then set path enter the following command:
set path=%path%;%windir%\Microsoft.NET\Framework\<version>

Now you can run your any C# source code from command prompt. Now we take an example. Open notepad(window’s button + R and type notepad for more shortcut see… Collection of useful command run on Command Prompt) and paste following code in it and save as FirstExample.cs
Remember one thing your file name and class name must be same.

Run Command

// The first program in C#
class FirstProgram
{
static void Main()
{
System.Console.WriteLine("Hello, My First Program on Command line using free C# compiler!");
}
}

Now open command prompt and compile FirstExample.cs

csc FirstExample.cs( for compile )
FirstExample (for Running compile fle)

see details I have got after compiling FirstExample.cs

Program Output

Further Reading

http://msdn2.microsoft.com/en-us/library/ms379563.aspx

Chetan love blogging. He regularly blogs at http://www.tipsntracks.com. You can connect with Chetan on Twitter, Facebook and Google Plus...

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

No comments yet.

Leave a comment

(required)

(required)

*
To prove that you're not a bot, enter this code
Anti-Spam Image