Getting Started.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Morris

    #1

    Getting Started.

    Hi, I'm just beginning to learn C# programming. I've got myself a copy
    of Borland C# Builder and a 'Teach Yourself C# in 21 days' manual.

    The examples in the book tell me how to build console applications, and
    compile and run them from the command line. I can run them from
    C#Builder itself, but a lot in the book depends on compiling and
    running the programs from the command line. How do I do this?

    If I create a class HelloWorld in file helloworld.cs in project
    Hello.bdsproj, how do I compile it? The book says : csc HelloWorld.cs
    but this just gives the error message "csc is not recognised as an internal
    or external command, operable program or batch file"

    What do I do?


    --
    _______________ ________
    /_______________ ______(_)
    | _______________ ______ email to
    | | |______________ ____(_) Peter_Morris_1 at
    | |/_______________ _____ btinternet dot com
    |______________ _______(_)




  • Eric Eggermann

    #2
    Re: Getting Started.


    "Peter Morris" <nospam.ple@se. com> wrote in message
    news:bqm7ob$m4t $1@titan.btinte rnet.com...[color=blue]
    > Hi, I'm just beginning to learn C# programming. I've got myself a copy
    > of Borland C# Builder and a 'Teach Yourself C# in 21 days' manual.
    >
    > The examples in the book tell me how to build console applications, and
    > compile and run them from the command line. I can run them from
    > C#Builder itself, but a lot in the book depends on compiling and
    > running the programs from the command line. How do I do this?
    >
    > If I create a class HelloWorld in file helloworld.cs in project
    > Hello.bdsproj, how do I compile it? The book says : csc HelloWorld.cs
    > but this just gives the error message "csc is not recognised as an[/color]
    internal[color=blue]
    > or external command, operable program or batch file"
    >
    > What do I do?[/color]

    Maybe you need to change the current directory to wherever your copy of csc
    is.
    ChDir [path to folder containg csc]
    Then try to compile again.

    HTH,
    Eric


    Comment

    • Morten Wennevik

      #3
      Re: Getting Started.

      You need to add a path to your framework directory containing all the
      executables
      typically c:\WINDOWS\Micr osoft.NET\Frame work\v1.1.4322 (or v1.0.3705 if
      you only have the old framework)
      that is where csc.exe should be.

      To add the path, right click on My Computer, choose properties->advanced
      and click the button saying "Environmen t variables" in the System
      variables window, scroll down and locate "Path" and click edit.
      Add the end of that line (DO NOT REMOVE ANYTHING or other things may fail
      to work properly) add

      ;c:\WINDOWS\Mic rosoft.NET\Fram ework\v1.1.4322

      the semicolon separates each path and after the semicolon you add your own
      path.
      When you try to run a program, windows will first try to find it in the
      current directory, and if it doesn't find it there it will search all
      paths listed in the path statement.

      --
      Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

      Comment

      • Eric Eggermann

        #4
        Re: Getting Started.


        "Peter Morris" <nospam.ple@se. com> wrote in message
        news:bqm7ob$m4t $1@titan.btinte rnet.com...[color=blue]
        > Hi, I'm just beginning to learn C# programming. I've got myself a copy
        > of Borland C# Builder and a 'Teach Yourself C# in 21 days' manual.
        >
        > The examples in the book tell me how to build console applications, and
        > compile and run them from the command line. I can run them from
        > C#Builder itself, but a lot in the book depends on compiling and
        > running the programs from the command line. How do I do this?
        >
        > If I create a class HelloWorld in file helloworld.cs in project
        > Hello.bdsproj, how do I compile it? The book says : csc HelloWorld.cs
        > but this just gives the error message "csc is not recognised as an[/color]
        internal[color=blue]
        > or external command, operable program or batch file"
        >
        > What do I do?[/color]

        Maybe you need to change the current directory to wherever your copy of csc
        is.
        ChDir [path to folder containg csc]
        Then try to compile again.

        HTH,
        Eric


        Comment

        • Morten Wennevik

          #5
          Re: Getting Started.

          You need to add a path to your framework directory containing all the
          executables
          typically c:\WINDOWS\Micr osoft.NET\Frame work\v1.1.4322 (or v1.0.3705 if
          you only have the old framework)
          that is where csc.exe should be.

          To add the path, right click on My Computer, choose properties->advanced
          and click the button saying "Environmen t variables" in the System
          variables window, scroll down and locate "Path" and click edit.
          Add the end of that line (DO NOT REMOVE ANYTHING or other things may fail
          to work properly) add

          ;c:\WINDOWS\Mic rosoft.NET\Fram ework\v1.1.4322

          the semicolon separates each path and after the semicolon you add your own
          path.
          When you try to run a program, windows will first try to find it in the
          current directory, and if it doesn't find it there it will search all
          paths listed in the path statement.

          --
          Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

          Comment

          • Bob Powell [MVP]

            #6
            Re: Getting Started.

            You need to run the "sdkvars.ba t" batch file that's in the SDK\bin
            directory.

            For command line compiles I created a batch file in the root directory that
            calls this one so that I can simply type "env" at the c prompt to get all
            the SDK paths set up. Here's my env.bat file. Note that you may have to
            change the path to match the location of your own .NET SDK.

            call "C:\Program Files\Microsoft Visual Studio .NET
            2003\SDK\v1.1\B in\sdkvars.bat"


            --
            Bob Powell [MVP]
            C#, System.Drawing

            The November edition of Well Formed is now available.
            Learn how to create Shell Extensions in managed code.


            Answer those GDI+ questions with the GDI+ FAQ


            Read my Blog at http://bobpowelldotnet.blogspot.com

            "Peter Morris" <nospam.ple@se. com> wrote in message
            news:bqm7ob$m4t $1@titan.btinte rnet.com...[color=blue]
            > Hi, I'm just beginning to learn C# programming. I've got myself a copy
            > of Borland C# Builder and a 'Teach Yourself C# in 21 days' manual.
            >
            > The examples in the book tell me how to build console applications, and
            > compile and run them from the command line. I can run them from
            > C#Builder itself, but a lot in the book depends on compiling and
            > running the programs from the command line. How do I do this?
            >
            > If I create a class HelloWorld in file helloworld.cs in project
            > Hello.bdsproj, how do I compile it? The book says : csc HelloWorld.cs
            > but this just gives the error message "csc is not recognised as an[/color]
            internal[color=blue]
            > or external command, operable program or batch file"
            >
            > What do I do?
            >
            >
            > --
            > _______________ ________
            > /_______________ ______(_)
            > | _______________ ______ email to
            > | | |______________ ____(_) Peter_Morris_1 at
            > | |/_______________ _____ btinternet dot com
            > |______________ _______(_)
            >
            >
            >
            >[/color]


            Comment

            • Bob Powell [MVP]

              #7
              Re: Getting Started.

              You need to run the "sdkvars.ba t" batch file that's in the SDK\bin
              directory.

              For command line compiles I created a batch file in the root directory that
              calls this one so that I can simply type "env" at the c prompt to get all
              the SDK paths set up. Here's my env.bat file. Note that you may have to
              change the path to match the location of your own .NET SDK.

              call "C:\Program Files\Microsoft Visual Studio .NET
              2003\SDK\v1.1\B in\sdkvars.bat"


              --
              Bob Powell [MVP]
              C#, System.Drawing

              The November edition of Well Formed is now available.
              Learn how to create Shell Extensions in managed code.


              Answer those GDI+ questions with the GDI+ FAQ


              Read my Blog at http://bobpowelldotnet.blogspot.com

              "Peter Morris" <nospam.ple@se. com> wrote in message
              news:bqm7ob$m4t $1@titan.btinte rnet.com...[color=blue]
              > Hi, I'm just beginning to learn C# programming. I've got myself a copy
              > of Borland C# Builder and a 'Teach Yourself C# in 21 days' manual.
              >
              > The examples in the book tell me how to build console applications, and
              > compile and run them from the command line. I can run them from
              > C#Builder itself, but a lot in the book depends on compiling and
              > running the programs from the command line. How do I do this?
              >
              > If I create a class HelloWorld in file helloworld.cs in project
              > Hello.bdsproj, how do I compile it? The book says : csc HelloWorld.cs
              > but this just gives the error message "csc is not recognised as an[/color]
              internal[color=blue]
              > or external command, operable program or batch file"
              >
              > What do I do?
              >
              >
              > --
              > _______________ ________
              > /_______________ ______(_)
              > | _______________ ______ email to
              > | | |______________ ____(_) Peter_Morris_1 at
              > | |/_______________ _____ btinternet dot com
              > |______________ _______(_)
              >
              >
              >
              >[/color]


              Comment

              Working...