472,993 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Debug.Assert behavioral change VS 2005/2008

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
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 1650
On May 22, 10:20 pm, "Rene" <a...@b.comwrote:
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
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
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...
1
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...
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...
1
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; ...
8
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...
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...
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.