Debug vs. Release Executable size

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
 
S

Scott M.

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.
 
F

Flare

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
 
S

Scott M.

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

Gernot Frisch

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
 
A

Alvin Bruney [MVP]

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.
 
R

Richard Grimes [MVP]

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
 
P

Pavel Lebedinsky

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top