Debug vs. Release Executable size

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pocket Rocket

    Debug vs. Release Executable size

    I am developing an application using Windows forms, C# and Visual
    Studio.Net. The executable size remains the same whether I built the debug
    or release version. Is it normal? Am I missing something? Thanks for ur
    help.

    PR


  • Scott M.

    #2
    Re: Debug vs. Release Executable size

    The physical size of the assembly will not always change when in release
    mode, yet you may still get a better performing assembly.

    Please do not cross-post your questions.


    "Pocket Rocket" <pocket_rocket@ hotmail.com> wrote in message
    news:u3dHYLR8DH A.2480@TK2MSFTN GP12.phx.gbl...[color=blue]
    > I am developing an application using Windows forms, C# and Visual
    > Studio.Net. The executable size remains the same whether I built the[/color]
    debug[color=blue]
    > or release version. Is it normal? Am I missing something? Thanks for ur
    > help.
    >
    > PR
    >
    >[/color]


    Comment

    • Flare

      #3
      Re: Debug vs. Release Executable size

      > > I am developing an application using Windows forms, C# and Visual[color=blue][color=green]
      > > Studio.Net. The executable size remains the same whether I built the[/color]
      > debug[color=green]
      > > or release version. Is it normal? Am I missing something? Thanks for[/color][/color]
      ur[color=blue][color=green]
      > > help.[/color][/color]

      I believe the debug information is located in the pdb file and only a little
      amount of infomation about debuging is in the actual assembly..Corre ct me if
      im wrong.

      Regards Anders


      Comment

      • Scott M.

        #4
        Re: Debug vs. Release Executable size

        You are correct. When you compile in release mode the .pdb file does not
        get created.


        "Flare" <nomail@sorry.d k> wrote in message
        news:%23iiMDpV8 DHA.632@TK2MSFT NGP12.phx.gbl.. .[color=blue][color=green][color=darkred]
        > > > I am developing an application using Windows forms, C# and Visual
        > > > Studio.Net. The executable size remains the same whether I built the[/color]
        > > debug[color=darkred]
        > > > or release version. Is it normal? Am I missing something? Thanks[/color][/color][/color]
        for[color=blue]
        > ur[color=green][color=darkred]
        > > > help.[/color][/color]
        >
        > I believe the debug information is located in the pdb file and only a[/color]
        little[color=blue]
        > amount of infomation about debuging is in the actual assembly..Corre ct me[/color]
        if[color=blue]
        > im wrong.
        >
        > Regards Anders
        >
        >[/color]


        Comment

        • Gernot Frisch

          #5
          Re: Debug vs. Release Executable size

          So, do I need the pdb file if I want to know the file+line where the
          program crashes on a computer without VS installed?
          -Gernot


          Comment

          • Scott M.

            #6
            Re: Debug vs. Release Executable size

            I can't say (I do have VS.NET and don't use the .pdb file myself).


            "Gernot Frisch" <Me@Privacy.net > wrote in message
            news:c0g3k3$15e ssu$1@ID-37212.news.uni-berlin.de...[color=blue]
            > So, do I need the pdb file if I want to know the file+line where the
            > program crashes on a computer without VS installed?
            > -Gernot
            >
            >[/color]


            Comment

            • Alvin Bruney [MVP]

              #7
              Re: Debug vs. Release Executable size

              > So, do I need the pdb file if I want to know the file+line where the[color=blue]
              > program crashes on a computer without VS installed?[/color]

              absolutely.
              but your release product should not be in debug mode for performance and
              possibly security resasons. the exception is when you have a special problem
              you can send a debug version to the customer to enable you to better
              troubleshoot the problem.

              --
              Regards,
              Alvin Bruney [ASP.NET MVP]
              Got tidbits? Get it here...

              "Gernot Frisch" <Me@Privacy.net > wrote in message
              news:c0g3k3$15e ssu$1@ID-37212.news.uni-berlin.de...[color=blue]
              > So, do I need the pdb file if I want to know the file+line where the
              > program crashes on a computer without VS installed?
              > -Gernot
              >
              >[/color]


              Comment

              • Richard Grimes [MVP]

                #8
                Re: Debug vs. Release Executable size

                Pocket Rocket wrote:[color=blue]
                > I am developing an application using Windows forms, C# and Visual
                > Studio.Net. The executable size remains the same whether I built the
                > debug or release version. Is it normal? Am I missing something?[/color]

                In addition to what has already been posted on this subject bear in mind
                that the compiler will add the [Debuggable] attribute to a debug build to
                turn off JIT optimization and to tell the .NET runtime to track how objects
                are used (and make this information available to the debugger). Thus, it is
                not a good idea to use debug build assemblies in a production environment
                because their performance will be impaired.

                Richard
                --
                my email evpuneqt@zicf.b et is encrypted with ROT13 (www.rot13.org)
                sign up for my free .NET newsletter at



                Comment

                • Pavel Lebedinsky

                  #9
                  Re: Debug vs. Release Executable size

                  Release code should be built with /debug:pdbonly. This way you get
                  both optimizations and symbols.

                  I'm not sure if VS project editor allows you to set this option though.

                  "Alvin Bruney [MVP]" wrote:
                  [color=blue][color=green]
                  > > So, do I need the pdb file if I want to know the file+line where the
                  > > program crashes on a computer without VS installed?[/color]
                  >
                  > absolutely.
                  > but your release product should not be in debug mode for performance and
                  > possibly security resasons. the exception is when you have a special[/color]
                  problem[color=blue]
                  > you can send a debug version to the customer to enable you to better
                  > troubleshoot the problem.[/color]


                  Comment

                  Working...