Debug::Assert showing up in release

H

High and dRy

Hello,
I created a simple .NET C++ console application. And the
Debug::Assert(false) statement is popping a message box in release
version also. Any idea why ?
Any complier settings I need to do to not show it in release version ?

#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
using namespace System::Diagnostics;

int _tmain()
{
// TODO: Please replace the sample code below with your own.
Console::WriteLine(S"Hello World");
Debug::Assert(false);
return 0;
}
 
D

Dirk

You should define a macro for your assert and conditionally compile it to
either Debug::Assert or __noop depending on _DEBUG/ NDEBUG.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top