Jump to content

For the adventurous Coding 101 viewers out there, it is possible to use Notepad or your favorite ...


G+_Joe Maruschek
 Share

Recommended Posts

For the adventurous Coding 101 viewers out there, it is possible to use Notepad or your favorite editor to write your C# programs, and then compile them on the command line.

 

Visual Studio installs an item on the start menu under Visual Studio 2013, Visual Studio Tools, called "Developer Command Prompt for VS2013".  Double-clicking that shortcut starts a command window with all the environment variables set up to run the C# compiler: csc.exe.  You can run "csc" from any folder, so change to one your folders where you have created your C# source code files with whatever editor you like.  For simple one-file console apps, you can compile them by typing "csc sourcefile.cs".  If there are no compile errors, a file called "sourcefile.exe" will be created in the same folder.  That's the file you run.  If you create more complex programs with multiple source files, or if you build WPF programs, you will likely need to use some of the command-line options for csc.  Check the docs on MSDN for a list of all the options.

http://msdn.microsoft.com/en-us/library/78f4aasd.aspx

Link to comment
Share on other sites

Irene Smith Some people perhaps don't like the Visual Studio editor and environment for whatever reason.  Perhaps they have their own favorite editor.   Padre and Snubs make it seem that you can't use notepad (or other editors) with C# like you can with Python and Perl.  Being a reader of Charles Petzold's books, I knew that it was possible. Petzold himself has a love-hate relationship with Visual Studio and prefers not to have Visual Studio generate code for him.  Check out this (rather long) article: http://charlespetzold.com/etc/DoesVisualStudioRotTheMind.html

Link to comment
Share on other sites

 Share

×
×
  • Create New...