Exception in mscorlib.dll

  • Thread starter Thread starter Ray Mitchell
  • Start date Start date
R

Ray Mitchell

Hello,

I have a VS 2003 application that gets the following error window:
"An unhandled exception of type 'System.ArgumentNullException' occurred in
mscorlib.dll"
"Additional information: Value cannot be null."

When I click the break button it says, "There is no source code available
for the current location."
When I click the help button it says that I should have handled the
exception. It seems that if an unhandled exception occurs in one of
Microsoft's dlls, how do I handle it or even catch it? How do I go about
debugging this? Is the source code for mscorlib.dll available?

Thanks,
Ray Mitchell
(e-mail address removed)
 
How can I determine what's in the call stack? Since this thing usually
occurs before the code I wrote is even reached I'm not sure what it's
doing when the exception happens. One of my recent additions to the
code (which doesn't seem to do what I want anyway) is:

this.SetStyle(ControlStyles.UserPaint|ControlStyles.AllPaintingInWmPaint
|ControlStyles.DoubleBuffer, true);

Probably just a red herring with regards to this problem, however.
 
Hi Ray,

If it happens before, could it be that an assembly is missing?
Anyway, I suggest you to pinpoint the problem.
For example, you might start deploying a "blank" project (only one form) and
see if it runs.
If it does, check your project references (if all of the assemblies required
are there).
 
Ray Mitchell said:
Hello,

I have a VS 2003 application that gets the following error window:
"An unhandled exception of type 'System.ArgumentNullException' occurred in
mscorlib.dll"
"Additional information: Value cannot be null."

When I click the break button it says, "There is no source code available
for the current location."
When I click the help button it says that I should have handled the
exception. It seems that if an unhandled exception occurs in one of
Microsoft's dlls, how do I handle it or even catch it? How do I go about
debugging this? Is the source code for mscorlib.dll available?

Thanks,
Ray Mitchell
(e-mail address removed)

I think I've been stung by this before, and probably will be again.
Apparently due to an undocumented "feature", occasionally VS2003 apparently
forgets which files have been modified and fails to rebuild them but marks
them as rebuilt, or maybe it just does a bad build that it keeps
propagating. Anyway if I rebuild the entire solution the problem
disappears. Looking back to when I was doing a lot of builds I now remember
encountering this about once or twice a week on all the machines I was
using. I found the simple answer was just to simply do a complete rebuild
every time. It takes a little longer, but not as much time as I've spent
chasing this phantom on several occasions. Thanks to you guys for your
suggestions.

Ray
 
Back
Top