Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should I use debug/release mode in Visual Studio?

I usually test my code locally on my work machine and then move it to development environment and then finally to production environment. What is the best way to use debug/release mode for this scenario? Do I only need to care about debug mode in my machine? Should I publish debug mode or release mode to development? I know probably I should publish using the release mode to production. I didn't really pay attention to all of this before so I have been working only in debug mode all the time, which I know I shouldn't.

Edit: Thanks for the answers. It looks like it's a good idea to only use debug mode in my own machine. Even though it's in development machine, it's basically releasing to the public (co-workers, qa) so it should be in release mode. And of course it should be release mode when releasing to prod.

like image 565
Hertanto Lie Avatar asked Jul 11 '09 17:07

Hertanto Lie


People also ask

What is the difference between release mode and debug mode in Visual Studio?

Visual Studio projects have separate release and debug configurations for your program. You build the debug version for debugging and the release version for the final release distribution. In debug configuration, your program compiles with full symbolic debug information and no optimization.

Should I build in debug or release?

Debug mode and Release mode are different configurations for building your . Net project. Programmers generally use the Debug mode for debugging step by step their . Net project and select the Release mode for the final build of Assembly file (.

What is release mode and when do you use it?

In release mode, debugging information is stripped out from the app and the compilation is realized with performance in mind. Remember, in release mode, like the profile, the application can only be run on physical devices, for the same reasons too.

Is release build faster than debug?

Debug Mode: In debug mode the application will be slow. Release Mode: In release mode the application will be faster. Debug Mode: In the debug mode code, which is under the debug, symbols will be executed. Release Mode: In release mode code, which is under the debug, symbols will not be executed.


1 Answers

When releasing / publishing an application you should do so in Release mode. Release mode is for just that, releasing applications. The code produced is typically more performant and many removes many checks that are more associated with the development phase of an application.

In a typical day, you should be developing in Debug mode. Most languages insert extra checks into a debug mode application. These spot more bugs but tend to slow down the application a bit.

Yet you must also do siginificant testing of Release mode as part of your development process. Customers will only actually see the Release mode version of your product and it's possible for bugs to be Debug / Release mode specific. The bug checks inserted in debug mode can introduce side effects that hide real bugs in your application.

like image 59
JaredPar Avatar answered Oct 21 '22 12:10

JaredPar