You may have noticed that in Visual Studio, most projects start off with Debug and Release profiles. This is used to control the way that the code is compiled. By default, Debug mode creates a pdb file and compiles the code to allow it to be used. A pdb file contains information which will help you debug the program, such as information about how the source code maps to the compiled code. This means that eg. when you get an Exception, the StackTrace property will give you information including line numbers.
On the other hand, a Release profile is much more optimised, both in terms of file size and code speed. However, it is entirely up to you whether you ship a Debug application. I wouldn’t recommend it for a large number of users, but for a constantly changing application in a small office, full stack traces with line numbers can be useful to find bugs that are difficult to trace.
- .NET Compilation Part 1: Profiles
- .NET Compilation Part 2: Conditional Compilation
No related posts.
Tags: .NET, Coding, Solutions, Visual Studio











