Debug vs. Release Executable size

  • Thread starter Thread starter Pocket Rocket
  • Start date Start date
P

Pocket Rocket

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
 
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.
 
I am developing an application using Windows forms, C# and Visual
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..Correct me if
im wrong.

Regards Anders
 
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
 
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?

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.
 
Pocket said:
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?

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
 
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.
 
Back
Top