Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How do you compile code from notepad?

How do you compile code from notepad?

Scheduled Pinned Locked Moved C#
question
9 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nathan Revka
    wrote on last edited by
    #1

    If it is difficult, then is there a portable compiler that I can use?

    P C P N D 6 Replies Last reply
    0
    • N Nathan Revka

      If it is difficult, then is there a portable compiler that I can use?

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      You compile it from the command line using csc.exe.

      "WPF has many lovers. It's a veritable porn star!" - Josh Smith

      As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

      My blog | My articles | MoXAML PowerToys | Onyx

      1 Reply Last reply
      0
      • N Nathan Revka

        If it is difficult, then is there a portable compiler that I can use?

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        The C# Express Edition is free. So is SharpDevelop.

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        P 1 Reply Last reply
        0
        • N Nathan Revka

          If it is difficult, then is there a portable compiler that I can use?

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          It's not difficult and more developers should learn to do it; it's a very useful tool to have. When you install .net, the C# and VB.net compilers are installed as well (these are the same compilers that Visual Studio uses). 0. Open a DOS box; there are at least two ways to do this: Start|Run cmd Start|Programs|Accesories|Command prompt Because I use a DOS box extensively I have it on my Quick launch toolbar 1. Determine which versions of the compiler you have:

          C:\>dir /s /b "c:\windows\microsoft.net\framework\csc.exe
          c:\windows\microsoft.net\framework\v1.1.4322\csc.exe
          c:\windows\microsoft.net\framework\v2.0.50727\csc.exe
          c:\windows\microsoft.net\framework\v3.5\csc.exe

          C:\>

          2. Execute the compiler of your choice, specifying your source code as a parameter:

          C:\>c:\windows\microsoft.net\framework\v3.5\csc.exe Hello.cs
          Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.1
          for Microsoft (R) .NET Framework version 3.5
          Copyright (C) Microsoft Corporation. All rights reserved.

          C:\>

          3. Execute the program:

          C:\>hello
          Hello, world!

          C:\>

          4. If you do this frequently, you may want to write a BAT file to do this:

          C:\>type csc.bat
          @c:\windows\microsoft.net\framework\v3.5\csc.exe %*

          C:\>

          5. And/or add the compiler's directory to the Path environment variable Start|Settings|Control panel|System|Advanced|Environment variables|System variables|Path|Edit

          1 Reply Last reply
          0
          • C Christian Graus

            The C# Express Edition is free. So is SharpDevelop.

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #5

            And xacc.IDE

            1 Reply Last reply
            0
            • N Nathan Revka

              If it is difficult, then is there a portable compiler that I can use?

              N Offline
              N Offline
              Natural_Demon
              wrote on last edited by
              #6

              don't do it with notepad. use the express version, microsoft intellisense is realy powerfull tool. it helps you write code while you type it. if you have coding experience with visual studio, please ignore this message. but if you haven't, i couldn't imagen to memorize or search for all the properties a component/control or whatever has.

              Bad = knowing 2 much

              1 Reply Last reply
              0
              • N Nathan Revka

                If it is difficult, then is there a portable compiler that I can use?

                D Offline
                D Offline
                darkelv
                wrote on last edited by
                #7

                Use EditPlus? You will still need the CSC.exe (Visual Studio) installed.

                D 1 Reply Last reply
                0
                • D darkelv

                  Use EditPlus? You will still need the CSC.exe (Visual Studio) installed.

                  D Offline
                  D Offline
                  dan sh
                  wrote on last edited by
                  #8

                  Doesn't csc.exe comes with the framework and not Visual Studio?

                  It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD

                  1 Reply Last reply
                  0
                  • N Nathan Revka

                    If it is difficult, then is there a portable compiler that I can use?

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    Why make life difficult for yourself? Get a copy of C# 2008 Express from Microsoft; it's a superb product and it is free. And if you still want to use Notepad and command line compile then check out the C# compiler pages on MSDN.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups