RE: Bogus System.ArgumentException has me puzzled
- From: jetan@xxxxxxxxxxxxxxxxxxxx ("Jeffrey Tan[MSFT]")
- Date: Mon, 08 Jan 2007 06:42:56 GMT
Hi BBM,
Based on my understanding, your .Net Winforma application is throwing
ArgumentException while executing a method, however, based on the code
review you can not understand why ArgumentException occurs, so you want to
find a way to identify the root cause of the ArgumentException.
First, can you tell me what version of debugger you are using, VS.net2003
or VS2005? I assume VS2005 now.
To accurately locate the code block generates the exception, you need
configure the debugger for 2 things:
1. Correctly load symbols for all modules/assemblies in your application.
This is because the exception may be thrown by some .Net BCL code(not your
written code), you need the symbol for various BCL assemblies.
2. Debuggers are passed 2 notifications during one exception: first chance
and second chance. The first chance notification is passed to your debugger
immediately when the code generates the exception, so this is what you
want. If your debuggers ignore the first chance exception, the OS/CLR will
only display a text to the "Output" window and call the "Catch ex As
Exception" you provided. If no "Catch ex As Exception" for this exception
is found, the debugger will finally be passed second chance exception
notification.
For #1, to set the symbol server path in VS2005, you should input
"srv*c:\LocalSymbols*http://msdl.microsoft.com/download/symbols;" in the
Tools | Options | Debugging | Symbols as the directory. This will tell the
VS2005 debugger to lookup symbol from the Microsoft symbol server
"http://msdl.microsoft.com/download/symbols" and cache the downloaded
symbol in "c:\LocalSymbols" folder.
Additionally, there is a new feature named "Just My Code" which is enabled
by default in VS2005. This means that VS2005 will not load symbol for
non-user code assemblies, such as all .Net BCL assemblies. So you should
disable this "Just My Code" feature from Tools | Options | Debugging, and
uncheck "Enable Just My Code" check box.(the VS2005 IDE maybe need
close&re-open to enable the setting)
Below link contains more information regarding JMC feature:
"Is 'Just my Code' for you?"
http://blogs.msdn.com/greggm/archive/2004/07/29/201315.aspx
To verify if the above 2 settings take effect, you may open "Module" window
after launching the application under debugger.
Note: symbol loading may require some time after you pressed F5, you may
check the "Output" window to verify the symbol loading process for each
modules.
For #2, you may open "Debug"->"Exceptions..." dialog, expand and find
"Common Language Runtime Exceptions" ->"System"->"System.ArgumentException"
node in the dialog. you should check the "Thrown" checkbox in the right and
click Ok. This tells the debugger to report the first chance exception to
the end user. Then you may open the "Call Stack" window to see the deepest
function frame for this exception.
Note: since you do not have the source code of .Net assemblies, debugger
may require you to open the "Disassembly" window for the exception code
location.
If you still have problem of locating the code accurately, I recommend you
create a little reproduce sample, I will give it a troubleshoot.
Thanks.
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Follow-Ups:
- References:
- Prev by Date: RE: Hide/Unhide modal and parent form.
- Next by Date: RE: Hide/Unhide modal and parent form.
- Previous by thread: Bogus System.ArgumentException has me puzzled
- Next by thread: RE: Bogus System.ArgumentException has me puzzled
- Index(es):
Relevant Pages
|