Compile and Run .NET program with just .NET framework on your system.
Did you know that every .NET framework installation also installs VB & C# compiler.
Using these compilers you can compile and run C# or VB.NET program on machine with just .NET framework installed. This can be useful on system where installing full visual studio is not an option.
Here is how to do it
If .NET framework installed on you system, C:\Windows\Microsoft.NET\Framework directory should list all the versions. Here is what is on my machine.
Once you find required .NET version, directory content should list csc.exe and vbs.exe compiler executable. As shown below.
Now use C# or VB compiler to compile the program as follows. For example use .NET 2.0 compiler to generate .exe c:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe Program.cs