Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

Need Some Assistance Getting Set Up To Develop From Command Prompt.

sharp help c# command line compiler programming

  • Please log in to reply
4 replies to this topic

#1 Psychonaut


    CC Lurker

  • New Member
  • Pip
  • 3 posts

Posted 17 April 2012 - 01:39 PM

Well for certain reasons i do not have access to an IDE , But i have the compiler included with the .net framework.
But I have been unable to find tutorials that are centered around this method, Im looking for tutorials that do not use an IDE. Also if anyone could link to me a tutorial on setting up where my compiled projects go..ect ect. Also just an FYI I do not have admin privelegages, so i made a .bat to load the path C:\Windows\Microsoft.NET\Framework\v4.0.30319 automaticaly in CMD.

I would greatly appreciate any help . Thank you in advance,If you feel i need to include more details please let me know.
  • 0

#2 Psychonaut


    CC Lurker

  • New Member
  • Pip
  • 3 posts

Posted 17 April 2012 - 03:00 PM

Also, Could someone tell me what does and what doesent need to be case sensitive, Im having trouble finding this documentation.
  • 0

#3 KineticShampoo


    CC Lurker

  • New Member
  • Pip
  • 7 posts
  • Location:Boston

Posted 19 April 2012 - 04:22 PM

C# is a case sensitive language.

string sergio = "Sergio";
string Sergio = "Sergio";

If you're just starting out and new to the C# language, writing a program from scratch without the use of an IDE will be near impossible if not counterintuitive. You may be able to cobble together a console application, but a Windows Forms application will be out of reach as the IDE generates a lot of code that even I don't know by heart (and we should I?).

I suggest you purchase the book Head First C# and follow it step by step to get some running experience.
  • 0

#4 kernelcoder


    CC Devotee

  • Expert Member
  • PipPipPipPipPipPip
  • 990 posts
  • Location:Dhaka
  • Programming Language:C, Java, C++, C#, Visual Basic .NET
  • Learning:Objective-C, PHP, Python, Delphi/Object Pascal

Posted 19 April 2012 - 08:07 PM

Does your csc(C# compiler) path set in PATH variable? If yes, you will be able to access csc from anywhere within your computer. If no, you have to access it will full-path from command prompt or you have to move inside the csc folder in command prompt.

For simplicity, let us consider that all your .cs file is in the csc directory and the output will be also in that directory. Followings are simple building scenarios. Let us consider that we are in the csc folder in command prompt.
  • To create an exe from A.cs file: csc /t:exe A.cs
  • To create a DLL from A.cs file: csc /t:library A.cs
  • ‚ÄčTo create an exe from A.cs file and referencing a dll (named ADll) for the exe: csc /t:exe A.cs /r:ADll.dll

To learn more, please read msdn here -- http://msdn.microsof...y/78f4aasd.aspx
  • 0

#5 Luthfi


    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1320 posts
  • Programming Language:PHP, Delphi/Object Pascal, Pascal, Transact-SQL
  • Learning:C, Java, PHP

Posted 20 April 2012 - 03:08 AM

Most programming language, including C# does not need IDE. IDE exists just to speed up the development process. Anything that can be done through IDE, can also be done through command prompt or simple text editor. Albeit when the former took a minute to do something that would take hours with command prompt or simple text editor.

I agree with kernelcoder, perhaps the first time you must learn, if you still want to go the "extreme" way, is to study how to build/compile from command prompt. Most options and their short explanation can be found by adding " /?" or " -?" (without the double quotes) when executing the compiler in command prompt.
  • 0

Also tagged with one or more of these keywords: sharp, help, c#, command line, compiler, programming

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download