0

I'm not an Visual Studio enthusiast (I prefer Linux/own tools), but I have to use it to keep up with my work team. Accessible Microsoft documentation is lacking, and I have to spend a lot of time just to make literally every standard bells and whistles work in a natural way.

I couldn't even find how to disable the annoying bell sound from beeping on every assert debug break.

Is there a simple way to disable it altogether, without changing the code (overloading asserts) from within the Visual Studio functionality?

Also, why does Visual Studio consider failed asserts such big deal that it needs to popup a dialog and play a sound in the first way? Is assert programming incompatible with VC++ development and if so, why?

Platform

VC++ 2017+ standard, cassert asserts

Windows 10, Visual Studio 2017, and a console C++ application.

Community
  • 1
  • 1
iantonuk
  • 1,178
  • 8
  • 28
  • See https://stackoverflow.com/questions/2836947/visual-studio-ide-i-want-it-to-make-a-sound-after-it-compiles-so-i-can-get-back – Sergey Vlasov Oct 01 '18 at 04:36
  • @Sergey Vlasov: No, that will not disable the sound for the debug assert dialog. Even when all are off there is still a sound when the debug assert dialog opens. – Peter Mortensen Oct 01 '18 at 17:15
  • 1
    @Sergey Vlasov, thanks for the link but the event in question is not the provided list( of 4) – iantonuk Oct 03 '18 at 23:58

1 Answers1

-3

Yes, there is a simple way. But it will also affect other parts of Windows (by disabling a sound that is used outside of Visual Studio).

Disable the sound for Windows sound Critical Stop.

HowTo

Windows 10:

Window + sounds → select "Change system sounds" → select "Critical Stop" (in the "Windows" section, the first section) → select "(None)" in the "Sounds" dropdown → press Apply.

It takes effect immediately after pressing Apply.

Screenshot: Setting system sound "Critical Stop" to "(None)"

Verification

To verify that Windows sound "Critical Stop" affects the behaviour of the debug assert dialog, set the sound to some distinct sound, like "Ring04.waw".

Platform

This was tested with Visual Studio 2012 on Windows 10, a Windows Forms application in C# (.NET), and the code line Trace.Assert(false, "Break in...");.

Community
  • 1
  • 1
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • 1
    That seems like an overkill for changing functionality pertaining just to VS. It looks like VS simply doesn't like asserts. actually the less invasive solution that removes the dialog entirely is to simply overload the asserts to a standard. But then again the question is WHY is VS not compatible assert programming. – iantonuk Oct 03 '18 at 23:46