Blue Theme Orange Theme Green Theme Red Theme
 
Nevron Gauge for SharePoint
Home | Forums | ASP.NET 2.0 Tutorials | Web Services | How Do I...? | Class Browser | WPF Quick Starts | Advertise with Us
 | Consulting  
Submit an Article Submit a Blog 
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
Nevron Gauge for SharePoint
Search :       Advanced Search »
Home » Miscellaneous » Debug versus Release build

Debug versus Release build

This article explains the difference between the Debug and Release Build. This article also explains the most common errors such as compile-time errors, run-time errors, logical errors and design errors etc.

Author Rank :
Page Views : 50159
Downloads : 0
Rating :
 Rate it
Level : Beginner
   Print Read/Post comments Post a comment  Similar Articles  
   Email to a friend  Bookmark  Author's other articles  
 
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
 Tag Cloud
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 

Visual Studio development environment enables you to test your compile-time, run-time, and logical errors by providing you a debug build option for your project. By using debug option, you can set breakpoints during compilation, watch the values of variables, registers, and threads and even you can change values of variables during compilation.

Debug versus Release build

There are two ways to build your project in VC++. One is debug version and other is release version. Microsoft uses separate MFC dlls for debug and release versions. If you will see MFC dlls in your system directory, its says MFC42d.dll and MFC42.dll for debug and release versions respectively. Debug version is to help programmers to help in detecting and correcting bugs in their programs.

Here are default options for debug and release build :

Version

Default Values

Win32 Debug

Full symbolic debugging information in Microsoft format No optimization (optimization generally makes debugging more difficult)

Win32 Release

No symbolic debugging information
Optimized for maximum speed

Error Types

During SDLC (Software Development Life Cycle), there are four types of errors.

Machine errors
Compile-time errors
Run-time errors
Logical and design errors

Machine errors are processor dependent and they are difficult to detect and correct. Since we use decimal system and values stored in the memory are in the form of bits. Lets say we devide a number 1.0 by 3. 1.0/3 = 3.333333....... and it goes till infinity. Processor can't store it and it truncates upto some level.

Compile-time errors are easy to find out. They are generally spelling mistakes or incorrect use of functions or parameters. For example, if i call AfxEnableControlContainer function as AfxEnablecontrolContainer, I get this error :

D:\samples\test\test.cpp(53) : error C2065: 'AfxEnablecontrolContainer' : undeclared identifier

Run-time errors occurs during program execution. Your program compiles fine but it blows up when you are doing something. Main cause of runtime errors is using unintialized variables. Here is an example:

int j ;
/* Do something and value of j = 12 */
j = 12 ;
For ( int i=0; j<10; j++ )
{
/* Do something */
}

So control will never execute this loop because value of j is greater than 10. The best way to get rid of this kinda bugs are proper initialization of variables.

Logical errors are very easy to do. They occur when your design or program logic is not correct. Here is an example with && operator

CRecordset recSet; /* Open recordset and something else */

If ( ! recSet.IsEOF() && recSet.IsBOF() ) // WRONG
{
/* Do something */
}
If ( ! ( recSet.IsEOF() && recSet.IsBOF() ) ) //
CORRECT
{
/* Do something */
}
while I wanted to check if recordset is not empty then do something.

Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
Login to add your contents and source code to this article
 [Top] Rate this article
 
 About the author
 
Mahesh Chand
Mahesh is the founder of C# Corner and Mindcracker Network, an author of several .NET programming books and a Microsoft MVP for 6 consecutive years. In his day to day work, Mahesh is a Senior Software Consultant with over 14 years of IT industry experience building systems for Financial and Banking, Engineering & Architectural, Imaging, Construction, Biological & Pharmaceuticals, Healthcare and Education industries. His expertise is Windows Forms, ASP.NET, Silverlight, WPF, WCF, Visual Studio 2010, SQL Server, and Oracle.  If you are looking for a Sharepoint, Windows Forms, ASP.NET, WPF, Silverlight, C#, VB.NET, Oracle, and SQL Server Consultant in Philadelphia area or remote location, drop me a line at MAHESH [AT] C-SHARPCORNER [DOT] COM.
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites – Click Here!
 
 Post a Feedback, Comment, or Question about this article
Subject:
Comment:
Team Foundation Server Hosting
Become a Sponsor
 Comments

 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.