Today I have come across executing C# (C Sharp) code with out Visual Studio, but you must have .NET Framework installed on your computer.
Procedure:
- Install .NET Framework, if not installed.
- Set the path of the .NET Framework Edition in environment variables or by using SET PATH command. ex: C:\Windows\Microsoft.NET\Framework\v3.5
- Write the C# script, Save file with extension .cs
ex: D:\csharp\trail.cs
using System;
public class Example
{
public static void Main()
{
Console.Write("\nIts Done\n");
Console.ReadLine(); //Waits until user press Return(Enter) key
}
} - Open command prompt, change the directory to specified folder(ex: D:\csharp\)
- Execute the following command cmd> csc trail.cs
- We will get trail.exe in the specified folder(ex: D:\csharp\), if it executed successfully
- Double click the trail.exe and see the output.
- We have successfully executed C#(C sharp) code without visual studio and with .NET Framework only
http://blogs.oberon.ch/tamberg/2007-10-17/compiling-csharp-without-visual-studio.html
Please post your comments and feedback.
2 comments:
yeah but what with Windows Programminh in C# ?
windows programming with C# can also be done without Visual Studio. We are using Visual Studio to make our life easy while coding. Intellisence (Autofill), Compile, Execute and Debug is easy.
Post a Comment