473,394 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Debug::Assert showing up in release

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;
}
Nov 17 '05 #1
1 1331
You should define a macro for your assert and conditionally compile it to
either Debug::Assert or __noop depending on _DEBUG/ NDEBUG.
"High and dRy" <sa********@yahoo.com> wrote in message
news:49**************************@posting.google.c om...
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;
}

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andreas Müller | last post by:
Hi, I just wanted to know if I risk any overhead using Debug.Assert. Will the compiler remove the complete statement on a releasey build? Thanks in advance, Andy
4
by: emma middlebrook | last post by:
I have a question regarding asserting ... here's some code: string GetAssertMessage() { ... prepare a message string and return it... } void SomeMethod() { ...
2
by: cody | last post by:
System.Diagnostics.Debug.Assert(); Hello??? A language should encourage programmers to heavily use the assert-feature, since it improves safety, stability, readability and maintainability of...
5
by: Mr Newbie | last post by:
Debug.Assert( False, "Why wont I display ??") I am trying to use this in my code but it wont display. The app is running on my local machine and the above code under a button click event. What...
4
by: Michi Henning | last post by:
When I write System.Diagnostics.Debug.Assert(False) the VB.NET compiler complains: 'Debug' is not a member of 'Diagnostics'. However, the object browser shows the Debug class inside...
2
by: Epetruk | last post by:
Hello, I have a problem where an application I am working on throws an OutOfMemoryException when I run it in Release mode, whereas it doesn't do this when I am running in Debug. The...
3
by: Brian Cryer | last post by:
It would be very handy to be able to stop the debugger on parts of code without having to explicitly set a breakpoint - either a "debugger.break" or "debug.assert" type of thing would do. I've not...
1
by: Rene | last post by:
Hi, Given the following code: static void Main(string args) { Debug.Assert(false, "Oopsy"); } If I run the code above using a computer running Visual Studio 2005, I get
10
by: Peter Morris | last post by:
In Delphi I used to use Assert as a development aid. During debug it would ensure that certain conditions were met but in the Release build the Asserts were not compiled into the application. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.