index > Visual C# General > What is the difference between debug mode and release mode?

What is the difference between debug mode and release mode?

Can anybody help me with the difference between release mode and debug mode!!
I have no idea of what they are and their significance.

sigme
Debug and Release are different configurations for building your project. As the name implies, you generally use the Debug mode for debugging your project, and the Release mode for the final build for end users. The Debug mode does not optimize the binary it produces (as optimizations can greatly complicate debugging), and generates additional data to aid debugging. The Release mode enables optimizations and generates less (or no) extra debug data.

Hope this helps,
-Tom Meschter
Software Dev, Visual C# IDE


Don't forget to mark the best replies as answers!
Tom Meschter
Also, changing from Debug to Release mode can screw up directory access, I've noticed. I had an application that always accessed a particular subdirectory. Always worked great until I changed to release mode and did the build. Maybe someone can explain why?


Bryan
BryanMiller
Because the release and debug versions run from different folders, then any code that uses relative paths may behave differently, because the relative paths may be different.

Matthew Watson
So, it's simply a matter of changing the relative path before Release? For example, I have an application that opens files using an openFileDialog control. I have two string variables, declared right after the "required designer variables", that I initialize in the form's constructor.

int myindex = Application.ExecutablePath.IndexOf("Debug");

app_directory = Application.ExecutablePath.Substring(0,myindex+6);

contacts_directory = app_directory + "Contacts\\";

Now, I then use string variable contacts_directory in the btnOpen_Click( ) event to specify the Contacts subdirectory of the application directory:

fileDialog.InitialDirectory = contacts_directory;

So, it's simply a matter of:

fileDialog.InitialDirectory = contacts_directory;

Now, never mind the fact that .InitialDirectory doesn't work right except for the first time btnOpen_Click( ) is used after the application starts. That's a separate issue that I know many, many people have complained about.

It sounds like what I need to do before building the Release is change "myindex" above to:

int myindex = Application.ExecutablePath.IndexOf("Release");

substituting "Release" for "Debug". It seems like if folders Debug and Release are on the same level, and each contains a Contacts subdirectory, that this substitution would suffice. But it does not. I get the following runtime error in debug mode:

<img src="http://www.geocities.com/kyrathaba/inline_images/app_error.JPG">

What is this "C:\DoContacts" directory?




Bryan
BryanMiller
reply 5

You can use google to search for other answers

 

More Articles

• Convert c++ file.h to c#.cs DllImport
• show release version
• Adding controls to a windows from from XML
• How do you convert int[,] into object[,]?
• iterating through items of a combobox
• Error with toolbar (when reinstall Crystal Report)
• InnoSetup .NET Detector
• procedure question sql
• Where does the compiled output for a web service go?
• Circle with line through it w/Drag and Drop
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• How to output debug information on progr
• tow ArrayLists values
• label.text repetition
• Accessing a child control from a parent
• Asyncronous socket server with windows s
• :(((((( I dont understand delegates ))))
• how i can give the regex class a Timeout
• .net 2005 beta 2 resources static class
• (S|AS)yncronous process & Exited event
• How to get html file from a specific url
• Project Guidance Please
• checkListBox to Array
• Any good examples of how to use Applicat
• Creating a Table Similar to that of MS-W
• Book , Easy and detailed information abo

Hot Articles

• DataGridView EditingControlShowing Cells
• copy datagrid to datatable
• Timer & Label
• Centralized Snippet control?
• System.Configuration.ConfigurationManage
• DataGrid/DataGridView
• How many Lines in RichTextBox
• TreeView adding nodes
• tab control selected index event
• get width of windows user control in inc
• accessing variable of one window form to
• How to launch a .swf file when button cl
• Read XMP Metadata information Using C#
• How to display unicode font in Windows 98
• Iterating Outlook Contacts

Recommend Articles

• Code generation from DLLs
• How Can I get Keyboard Layout?
• state of layout property
• Developing C# with Generics
• Download file(MP3) with progressbar
• untyped database in an foreach loop
• parsing html header Vcsharp 2005 Express
• Sound In Form...
• form size
• Problem with printing
• Keypress event in Beta2
• How can I make a method wait for a certa
• Multithreaded application failing in dif
• how to make Yahoo mess statusbar effect..
• How can I make datagrid display the capt