473,616 Members | 2,973 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Debug.Assert behavioral change VS 2005/2008

Hi,

Given the following code:

static void Main(string[] args)
{
Debug.Assert(fa lse, "Oopsy");
}

If I run the code above using a computer running Visual Studio 2005, I get
the assert message popup and when I click on the "Retry" button on the
popup message immediately go into debugging mode.

If I do the exact same thing under Visual Studio 2008, I get the assert
popup message but when I click on the "Retry" button I get a message stating
"There is no source code available for the current location." If I then
click the "OK" button on that message box I then enter debugging mode.

The problem here is that I don't think I should be getting the "There is no
source code available for the current location." message box.

Is there something I am doing wrong here? Is this a bug on Visual Studio
2008 or is just some setting that I have to change. Do you guys also
experience the same behavior?

Thank you.

Jun 27 '08 #1
1 1680
On May 22, 10:20 pm, "Rene" <a...@b.comwrot e:
Hi,

Given the following code:

static void Main(string[] args)
{
Debug.Assert(fa lse, "Oopsy");

}

If I run the code above using a computer running Visual Studio 2005, I get
the assert message popup and when I click on the "Retry" button on the
popup message immediately go into debugging mode.

If I do the exact same thing under Visual Studio 2008, I get the assert
popup message but when I click on the "Retry" button I get a message stating
"There is no source code available for the current location." If I then
click the "OK" button on that message box I then enter debugging mode.

The problem here is that I don't think I should be getting the "There is no
source code available for the current location." message box.

Is there something I am doing wrong here? Is this a bug on Visual Studio
2008 or is just some setting that I have to change. Do you guys also
experience the same behavior?

Thank you.
If you are in Release mode, try going to Tools...Options and
unclicking "Warn if no user code".
Jun 27 '08 #2

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

Similar topics

4
4521
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
5860
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 software. Most language designers recognized this, see C/C++ and Java which supports an assert keyword. My question now is, will C# support in future a single keyword for System.Diagnostics.Debug.Assert(), just like lock is a keyword for...
1
1344
by: High and dRy | last post by:
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;
5
2463
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 am I missing ? Cheers mr N . . .
4
2076
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 Diagnostics just fine, and shows the Assert methods inside Debug.
1
1309
by: spirytuspl | last post by:
I'am running this code highly threaded environment but for some reason Debug.Assert fails. Why is it and how can I stop it from happening? public class CMSShop { public int items = 0; public void inc() {
8
2020
by: Zytan | last post by:
I am getting a Debug.Assert() firing which shows a mesasge so large that it is cropped. But it crops off the beginning. So, I have no idea what assertion is. My code is not complex. It's just the main form invoking the c'tor of a class, and this c'tor calls a static function that fires the assertion. So, it's just Form1 -Class C'tor -Membe Function. What can I do about this? Is Debug.Assert() really this useless? There has to be a...
3
2085
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 come across anything, but is there anything in (VB).NET that would allow me to do this? TIA. -- Brian Cryer www.cryer.co.uk/brian
10
3382
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 am assuming this is the same with ..NET too? Debug.Assert isn't compiled into a Release build? The other thing I am curious about is this public void DoSomething(Person p) { if (p == null)
0
8203
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8647
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8592
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8449
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7121
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6097
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5550
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4141
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1445
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.