Deploying a production application in debug mode rather than release mode?

I work in a store that supports a fairly new application. The application still has its share of errors, and numerous tickets arrive daily. The error information that we give with these tickets is not as useful as it could be, because the application was compiled in Release mode, which I read, less and faster (it makes sense).

Are there any implications for deploying a .NET application for production that was compiled in debug mode? I would expect it to be a little slower, but I read the difference in nominal. This would assure us that when we get errors in tickets, we have a line number associated with these errors, and this, of course, makes debugging easier.

Any large red flags that would prevent you from doing this? I am tasked with exploring this possibility. So thanks for any feedback.

+6
c # deployment
source share
6 answers

Deploying your application in DEBUG mode instead of Release mode will slow down your performance. Of course, compromises can be made. I would suggest one of the following options:

  • Look at adding a global error handler to OnError in your global.asax -
  • Look at a compromise similar to this proposed by Scott Hanselm
+3
source share

My experience is that this might work if you are thinking of a desktop application (winforms / WPF), but under no circumstances should you try to use this asp.net application.

+1
source share

You noted this [vb.net], you cannot send debug builds or programs that use WithEvents. There is a known and inactive memory leak for WeakReference instances if there is no debugger. They are used to support Edit + Continue.

The first thing you can do is send the .pdb files along with your applications. In C # IDE use Project + Properties, Build, Advanced tab, change Debug Info to "Full". You will receive information about the line number in the exception stack trace.

You cannot completely trust the line number, the JIT optimizer will move the code so that it runs faster. And built-in short functions like getters properties. You can add the yourapp.ini file in the same directory as the executable that disables the JIT optimizer

[.NET Framework Debugging Control] GenerateTrackingInfo=1 AllowOptimize=0 
+1
source share

It all depends on the importance of your production environment, business requirements and productivity. Nothing is strict.

0
source share

Deploying Debug collections is a red flag for me, although it's not unheard of. Is this a desktop or server application? Any calls to Debug.Assert that may not be a problem can be a problem, since they can close your application and / or cause a debugger to connect (VS.NET is not the only debugger, and if I remember .net fx installs a light debugger). Although it can be useful as a developer, it can certainly confuse a normal person.

One option that works well, rather than debug builds, ensures that your error reporting mechanism includes (either outputs or logs) stack trace information from any thrown exceptions . This help helps identify errors very well without requiring pdbs.

0
source share

If this is a desktop application, you can try it with several clients, but heed the tips provided in other answers. Try someone who is a stronger user or has a lot of problems that you may wish for voluntarily.

0
source share

All Articles