Hello Everyone,
 
I attached a patch (diff.txt) to this message for a bug found in
src/ObjectRenderer/DefaultRenderer.cs in the
DefaultRenderer.RenderException method.  The bug occurs when an
unamanged object throws an exception the Source property throws an
exception.  This is a bug in C++ .NET in the .NET Framework 1.1.  

Here is the snippet of code:

-------------------------------------------------------------
// If a C++ .NET exception was thrown from an unmanaged
// object then the Source property will throw an exception. 
try
{
        if (ex.Source != null && ex.Source.Length > 0)
        {
                writer.Write("Source: ");
                writer.WriteLine(ex.Source);
        }
}
catch
{
        writer.WriteLine("Source: None (Exception occurred)");
}
-------------------------------------------------------------

The patch I've attached is built against Rev 1.3 in CVS so you should be
able to add it in very easily.

Best regards,

Brent.

--
Brent R. Matzelle
Senior Software Developer
Mobility Technologies
610.407.7400 x2108

258c258,260
<                       if (ex.Source != null && ex.Source.Length > 0)
---
>                       // If a C++ .NET exception was thrown from an unmanaged
>                       // object then the Source property will throw an 
> exception. 
>                       try
260,261c262,266
<                               writer.Write("Source: ");
<                               writer.WriteLine(ex.Source);
---
>                               if (ex.Source != null && ex.Source.Length > 0)
>                               {
>                                       writer.Write("Source: ");
>                                       writer.WriteLine(ex.Source);
>                               }
263c268
<                       if (ex.StackTrace != null && ex.StackTrace.Length > 0)
---
>                       catch
265c270
<                               writer.WriteLine(ex.StackTrace);
---
>                               writer.WriteLine("Source: None (Exception 
> occurred)");

Reply via email to