Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,151,607 members, 7,812,993 topics. Date: Tuesday, 30 April 2024 at 02:02 AM

How To Run C# Codes Without Having To Install Visual Studio - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / How To Run C# Codes Without Having To Install Visual Studio (1978 Views)

I Need Help On Visual Studio 2008 / Matlab And Visual Studio Expert Needed / Metroframework For C# Applications In Visual Studio (2) (3) (4)

(1) (Reply) (Go Down)

How To Run C# Codes Without Having To Install Visual Studio by project7(m): 11:06am On May 20, 2016
For those that want to learn c# or test a simple code but do not want the burden of having to install the heavy resource consuming visual studio, you can do this.

All that is needed is to make sure your computer has the .NET framework already installed and a c# compiler exist in the computer.

To confirm this, check that the c# compiler (csc.exe) is in the location:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\

1) Now create a folder where you want your program.

2) In the folder create a .BAT file with the content below.

// my-folder/compile-and-run.bat
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\csc.exe program.cs
program.exe
pause


3) Also in the folder create a .CS file with your c# codes.

// my-folder/program.cs
using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, world!" );
Console.ReadLine();
}
}
}



4) Run the .BAT file to compile your program and run it.
Re: How To Run C# Codes Without Having To Install Visual Studio by Nobody: 11:19am On May 20, 2016
Only console program you can't use xaml or windows form application . ideone is better . Download visual studio .

Nice tutorial , keep it up .
Re: How To Run C# Codes Without Having To Install Visual Studio by Nobody: 2:05pm On May 20, 2016
Re: How To Run C# Codes Without Having To Install Visual Studio by project7(m): 12:57pm On May 21, 2016
DanielTheGeek:
http://csharppad.com/

Not everyone has the privilege to have their computer connected to the internet all the time.
Re: How To Run C# Codes Without Having To Install Visual Studio by project7(m): 1:03pm On May 21, 2016
proxy20:
Only console program you can't use xaml or windows form application . ideone is better . Download visual studio .

Nice tutorial , keep it up .

Not everyone has the privilege to install Visual Studio on all the computers he or she has access to.
And also some chap might be on http://www.dotnetperls.com/ studying c# and need to try out the example codes there. I personally spent 6 months looking for a visual studio CD four years ago you might not get one readily but need to test some codes.
Thanks.
Re: How To Run C# Codes Without Having To Install Visual Studio by Nobody: 12:26am On May 22, 2016
proxy20:
Only console program you can't use xaml or windows form application . ideone is better . Download visual studio . Nice tutorial , keep it up .

You can write a windows form appliaction in C# with notepad, this method is for you if you don't want to use visual studio.net

Re: How To Run C# Codes Without Having To Install Visual Studio by Nobody: 12:40pm On May 22, 2016
Febup:


You can write a windows form appliaction in C# with notepad, this method is for you if you don't want to use visual studio.net
it may not work when coding advance winform Controls . It is still limited .
Re: How To Run C# Codes Without Having To Install Visual Studio by Nobody: 12:44pm On May 22, 2016
proxy20:

it may not work when coding advance winform Controls . It is still limited .

No, in fact you can do more advance stuff without IDE only it will be time consuming.
Re: How To Run C# Codes Without Having To Install Visual Studio by Nobody: 12:55pm On May 22, 2016
Febup:


No, in fact you can do more advance stuff without IDE only it will be time consuming.

lol , like wasting the whole day compiling the code on command prompt without detecting the errors quickly . This is 2016 not 2000 . Errors will make you tired and quit the program .
Re: How To Run C# Codes Without Having To Install Visual Studio by Nobody: 1:03pm On May 22, 2016
proxy20:


lol , like wasting the whole day compiling the code on command prompt without detecting the errors quickly . This is 2016 not 2000 . Errors will make you tired and quit the program .

You are right mate!

(1) (Reply)

Any Body Reading Head First C#-lab 2 / Integrate Paystack On Android / Serious Php/go/scala/python/javascript Developers Needed To Join A Start Up.

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 13
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.