Building .NET 3.0

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike  Schilling

    #1

    Building .NET 3.0

    I recently installed the .NET 3.0 framework (behind the time, I know), and
    am seeing an issue building it.

    Because 3.0 doesn't upgrade csc.exe, I'm still using the 2.0 csc to build
    things. Since the assemblies added in 3.0 aren't in the 2.0 directory tree,
    their names need to be fully qualified, so I wind up with command lines
    like:

    csc /r:"c:\WINDOWS\M icrosoft.NET\Fr amework\v3.0\Wi ndows Communication
    Foundation"\Sys tem.Runtime.Ser ialization.dll ParseXml.cs

    Did I miss some way to simplify this, or is that just how it works?



  • Scott M.

    #2
    Re: Building .NET 3.0

    Just a small correction about your question: it doesn't relate to
    "building", it relates to "compiling" . Building is taken care of by
    msbuild.exe and is a different than compiling.

    As for your compiling, are you using a version of Visual Studio? If so, you
    shouldn't have to do any command line work.




    "Mike Schilling" <mscottschillin g@hotmail.comwr ote in message
    news:%23X8gSkEt IHA.5472@TK2MSF TNGP06.phx.gbl. ..
    >I recently installed the .NET 3.0 framework (behind the time, I know), and
    >am seeing an issue building it.
    >
    Because 3.0 doesn't upgrade csc.exe, I'm still using the 2.0 csc to build
    things. Since the assemblies added in 3.0 aren't in the 2.0 directory
    tree, their names need to be fully qualified, so I wind up with command
    lines like:
    >
    csc /r:"c:\WINDOWS\M icrosoft.NET\Fr amework\v3.0\Wi ndows Communication
    Foundation"\Sys tem.Runtime.Ser ialization.dll ParseXml.cs
    >
    Did I miss some way to simplify this, or is that just how it works?
    >
    >
    >

    Comment

    • Ignacio Machin ( .NET/ C# MVP )

      #3
      Re: Building .NET 3.0

      On May 12, 11:58 am, "Mike Schilling" <mscottschill.. .@hotmail.com>
      wrote:
      I recently installed the .NET 3.0 framework (behind the time, I know), and
      am seeing an issue building it.
      >
      Because 3.0 doesn't upgrade csc.exe, I'm still using the 2.0 csc to build
      things.  Since the assemblies added in 3.0 aren't in the 2.0 directory tree,
      their names need to be fully qualified, so I wind up with command lines
      like:
      >
      csc /r:"c:\WINDOWS\M icrosoft.NET\Fr amework\v3.0\Wi ndows Communication
      Foundation"\Sys tem.Runtime.Ser ialization.dll ParseXml.cs
      >
      Did I miss some way to simplify this, or is that just how it works?
      Out of curiosity, why don't you simply install 2008 express?

      Comment

      • Mike  Schilling

        #4
        Re: Building .NET 3.0

        Ignacio Machin ( .NET/ C# MVP ) wrote:
        On May 12, 11:58 am, "Mike Schilling" <mscottschill.. .@hotmail.com>
        wrote:
        >I recently installed the .NET 3.0 framework (behind the time, I
        >know), and am seeing an issue building it.
        >>
        >Because 3.0 doesn't upgrade csc.exe, I'm still using the 2.0 csc to
        >build things. Since the assemblies added in 3.0 aren't in the 2.0
        >directory tree, their names need to be fully qualified, so I wind up
        >with command lines like:
        >>
        >csc /r:"c:\WINDOWS\M icrosoft.NET\Fr amework\v3.0\Wi ndows Communication
        >Foundation"\Sy stem.Runtime.Se rialization.dll ParseXml.cs
        >>
        >Did I miss some way to simplify this, or is that just how it works?
        >
        Out of curiosity, why don't you simply install 2008 express?
        We have a mixed environment, of which .NET is only a fraction, and thus our
        build environment is command-line driven rather than .NET-centric. Nor do I
        want to have to install and maintain VS.NET on headless machines used only
        to do builds.

        Anyway, that all aside, is there a way to simplify these command lines, or
        do the assembly names have to be fully qualified?


        Comment

        • Jon Skeet [C# MVP]

          #5
          Re: Building .NET 3.0

          Mike Schilling <mscottschillin g@hotmail.comwr ote:
          Out of curiosity, why don't you simply install 2008 express?
          >
          We have a mixed environment, of which .NET is only a fraction, and thus our
          build environment is command-line driven rather than .NET-centric. Nor do I
          want to have to install and maintain VS.NET on headless machines used only
          to do builds.
          So use MSBuild - create project/solution files with Visual Studio, and
          just run MSBuild on those and let it deal with everything.
          Anyway, that all aside, is there a way to simplify these command lines, or
          do the assembly names have to be fully qualified?
          You could add the references to the default response list for csc.

          --
          Jon Skeet - <skeet@pobox.co m>
          Web site: http://www.pobox.com/~skeet
          Blog: http://www.msmvps.com/jon.skeet
          C# in Depth: http://csharpindepth.com

          Comment

          • =?ISO-8859-1?Q?Arne_Vajh=F8j?=

            #6
            Re: Building .NET 3.0

            Mike Schilling wrote:
            I recently installed the .NET 3.0 framework (behind the time, I know), and
            am seeing an issue building it.
            >
            Because 3.0 doesn't upgrade csc.exe, I'm still using the 2.0 csc to build
            things. Since the assemblies added in 3.0 aren't in the 2.0 directory tree,
            their names need to be fully qualified, so I wind up with command lines
            like:
            >
            csc /r:"c:\WINDOWS\M icrosoft.NET\Fr amework\v3.0\Wi ndows Communication
            Foundation"\Sys tem.Runtime.Ser ialization.dll ParseXml.cs
            >
            Did I miss some way to simplify this, or is that just how it works?
            msbuild, Csc task, AdditionalLibPa ths + References attributes

            or

            nant, csc task, references nested element and ant style fileset

            Arne

            Comment

            • Mike  Schilling

              #7
              Re: Building .NET 3.0

              Jon Skeet [C# MVP] wrote:
              Mike Schilling <mscottschillin g@hotmail.comwr ote:
              >>Out of curiosity, why don't you simply install 2008 express?
              >>
              >We have a mixed environment, of which .NET is only a fraction, and
              >thus our build environment is command-line driven rather than
              >.NET-centric. Nor do I want to have to install and maintain VS.NET
              >on headless machines used only to do builds.
              >
              So use MSBuild - create project/solution files with Visual Studio, and
              just run MSBuild on those and let it deal with everything.
              Does MSBuild integrate well with Ant? That's what drives the build (Ant has
              build-in tasks to run csc, ilasm, etc.)
              >
              >Anyway, that all aside, is there a way to simplify these command
              >lines, or do the assembly names have to be fully qualified?
              >
              You could add the references to the default response list for csc.
              Aha! And how do I do that?


              Comment

              • Jon Skeet [C# MVP]

                #8
                Re: Building .NET 3.0

                Mike Schilling <mscottschillin g@hotmail.comwr ote:
                So use MSBuild - create project/solution files with Visual Studio, and
                just run MSBuild on those and let it deal with everything.
                >
                Does MSBuild integrate well with Ant? That's what drives the build (Ant has
                build-in tasks to run csc, ilasm, etc.)
                There's an MSBuild task in the Ant .NET library:


                Alternatively just execute it with exec task.
                Anyway, that all aside, is there a way to simplify these command
                lines, or do the assembly names have to be fully qualified?
                You could add the references to the default response list for csc.
                >
                Aha! And how do I do that?
                Find csc.rsp in your framework directory and edit it. It's not a
                terribly nice way of doing it though - running MSBuild would be much
                better.

                --
                Jon Skeet - <skeet@pobox.co m>
                Web site: http://www.pobox.com/~skeet
                Blog: http://www.msmvps.com/jon.skeet
                C# in Depth: http://csharpindepth.com

                Comment

                • =?ISO-8859-1?Q?Arne_Vajh=F8j?=

                  #9
                  Re: Building .NET 3.0

                  Mike Schilling wrote:
                  Jon Skeet [C# MVP] wrote:
                  >Mike Schilling <mscottschillin g@hotmail.comwr ote:
                  >>>Out of curiosity, why don't you simply install 2008 express?
                  >>We have a mixed environment, of which .NET is only a fraction, and
                  >>thus our build environment is command-line driven rather than
                  >>.NET-centric. Nor do I want to have to install and maintain VS.NET
                  >>on headless machines used only to do builds.
                  >So use MSBuild - create project/solution files with Visual Studio, and
                  >just run MSBuild on those and let it deal with everything.
                  >
                  Does MSBuild integrate well with Ant? That's what drives the build (Ant has
                  build-in tasks to run csc, ilasm, etc.)
                  I would find it tempting to use nant because:
                  - nant supports everything you will need
                  - the nant syntax is so close to ant that it will be easy to use

                  Arne

                  Comment

                  • Mike Schilling

                    #10
                    Re: Building .NET 3.0

                    Arne Vajhøj wrote:
                    Mike Schilling wrote:
                    >Jon Skeet [C# MVP] wrote:
                    >>Mike Schilling <mscottschillin g@hotmail.comwr ote:
                    >>>>Out of curiosity, why don't you simply install 2008 express?
                    >>>We have a mixed environment, of which .NET is only a fraction,
                    >>>and
                    >>>thus our build environment is command-line driven rather than
                    >>>.NET-centric. Nor do I want to have to install and maintain
                    >>>VS.NET
                    >>>on headless machines used only to do builds.
                    >>So use MSBuild - create project/solution files with Visual Studio,
                    >>and just run MSBuild on those and let it deal with everything.
                    >>
                    >Does MSBuild integrate well with Ant? That's what drives the build
                    >(Ant has build-in tasks to run csc, ilasm, etc.)
                    >
                    I would find it tempting to use nant because:
                    - nant supports everything you will need
                    As I said above, .NET is a fraction of the entire build. Ant does a
                    fine job of running command-line programs, and I suspect nant does a
                    poor one of invoking the Java compiler within its active JVM.,


                    Comment

                    • Alex Meleta

                      #11
                      Re: Building .NET 3.0

                      Hi Mike,

                      Because csc doesn't automatically resolve references to GAC assemblies than
                      using DOS variables can be the way. For instance, folllowing example simplifying
                      your input just to use the variables:

                      @set net20path=%wind ir%\Microsoft.N ET\Framework\v2 .0.50727
                      @set net30path=%wind ir%\Microsoft.N ET\Framework\v3 .0
                      @set net30wcfpath=%n et30path%\Windo ws Communication Foundation
                      @set csc=%net20path% \csc.exe

                      @set refserializatio n=%net30wcfpath %\System.Runtim e.Serialization .dll

                      %csc% /r:"%refserializ ation%" ParseXml.cs

                      Regards, Alex
                      [TechBlog] http://devkids.blogspot.com

                      MSI recently installed the .NET 3.0 framework (behind the time, I
                      MSknow), and am seeing an issue building it.
                      MS>
                      MSBecause 3.0 doesn't upgrade csc.exe, I'm still using the 2.0 csc to
                      MSbuild things. Since the assemblies added in 3.0 aren't in the 2.0
                      MSdirectory tree, their names need to be fully qualified, so I wind up
                      MSwith command lines like:
                      MS>
                      MScsc /r:"c:\WINDOWS\M icrosoft.NET\Fr amework\v3.0\Wi ndows
                      MSCommunication Foundation"\Sys tem.Runtime.Ser ialization.dll
                      MSParseXml.cs
                      MS>
                      MSDid I miss some way to simplify this, or is that just how it works?
                      MS>


                      Comment

                      • =?ISO-8859-1?Q?Arne_Vajh=F8j?=

                        #12
                        Re: Building .NET 3.0

                        Mike Schilling wrote:
                        Arne Vajhøj wrote:
                        >Mike Schilling wrote:
                        >>Jon Skeet [C# MVP] wrote:
                        >>>Mike Schilling <mscottschillin g@hotmail.comwr ote:
                        >>>>>Out of curiosity, why don't you simply install 2008 express?
                        >>>>We have a mixed environment, of which .NET is only a fraction,
                        >>>>and
                        >>>>thus our build environment is command-line driven rather than
                        >>>>.NET-centric. Nor do I want to have to install and maintain
                        >>>>VS.NET
                        >>>>on headless machines used only to do builds.
                        >>>So use MSBuild - create project/solution files with Visual Studio,
                        >>>and just run MSBuild on those and let it deal with everything.
                        >>Does MSBuild integrate well with Ant? That's what drives the build
                        >>(Ant has build-in tasks to run csc, ilasm, etc.)
                        >I would find it tempting to use nant because:
                        >- nant supports everything you will need
                        As I said above, .NET is a fraction of the entire build. Ant does a
                        fine job of running command-line programs, and I suspect nant does a
                        poor one of invoking the Java compiler within its active JVM.,
                        True, but you can call nant from ant !!

                        Arne

                        Comment

                        Working...