Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to "debug" a release build of a C# app in VS 2010

I have an excel addin that works fine in debug and release mode when I build / run from VS2010. However, when I deploy it using a windows installer it doesn't operate properly.

I'm not sure what the problem is or even if "debugging" the release code will help.

Any tips on how I might find what the problem is?

EDIT

What I mean by "doesn't operate properly" is that when i hit buttons etc nothing happens and it just hangs.

Thanks

like image 798
Pat Mustard Avatar asked Oct 11 '13 07:10

Pat Mustard


People also ask

Can we debug in Release mode C#?

The release configuration of your program has no symbolic debug information and is fully optimized. For managed code and C++ code, debug information can be generated in . pdb files, depending on the compiler options that are used.

What is the difference between a debug build and a Release build?

Release vs Debug and it depends on what language you are using, Debug includes debugging information in the compiled files (allowing easy debugging) while Release usually has optimizations enabled. They each define different symbols that can be checked in your program, but they are language-specific macros.

Can you use breakpoints in Release mode?

You can then put a breakpoint on that int declaration line, and it'll be hit, even in release mode. Then just step up the stack in the debugger back to the function you actually wanted a breakpoint in.

Is Release build faster than debug?

Default Debug build is x240 times slower than default Release build. With all the aforementioned settings enabled, Fast Debug build is only x3 times slower than Release build (and that's with optimization still disabled!).


2 Answers

in higher version of visual studio, debug release build enabled, when i uncheck " enable just my code" in following menu "tools -> options-> debugging ->general"

like image 139
s.c Avatar answered Oct 05 '22 08:10

s.c


you also need to ensure the Optimize code is unchecked enter image description here

like image 20
Moustafa Khalil Avatar answered Oct 05 '22 10:10

Moustafa Khalil