1

Closed

System.ArgumentNullException on method which call Custum Exception

description

I create my exception :
 
public class MyException : Exception
{
public MyException()
{

}

public MyException(String msg) : base(msg)
{
 
}
}
 
In other class (in same assembly), i write this :
public class Test
{
private void MethodNonUtilise(int? a)
{
  throw new MyException("salut");
}
}
 
And in reflector, when i "Find Exception" on MethodNonUtilise(int? a) then there is this error :
 
La valeur ne peut pas être null.
Nom du paramètre : type
 
System.ArgumentNullException
 
à Spackle.Extensions.ObjectExtensions.CheckParameterForNull(Object this, String parameterName)
à ExceptionFinder.Analyzers.LeakedExceptionsMethodInstructionsAnalyzer.OnAnalyze()
à ExceptionFinder.Analyzers.LeakedExceptionsInstructionsAnalyzer.Analyze()
à ExceptionFinder.Analyzers.MethodExceptionAnalyzer.Analyze()
à ExceptionFinder.ExceptionFinderView.ShowLeakedExceptions(IMethodDeclaration methodItem)
à ExceptionFinder.ExceptionFinderPackage.ShowAnalysis()
à ExceptionFinder.ExceptionFinderPackage.OnExceptionFinderButtonClick(Object sender, EventArgs e)
à ᝸.ᜆ.ᜀ(EventArgs A_0)
à ᝸.ᜆ.ᜃ()
à ᝸.ᜅ.ᜀ.ᜂ(EventArgs A_0)
à System.Windows.Forms.MenuItem.MenuItemData.Execute()
à System.Windows.Forms.Command.Invoke()
à System.Windows.Forms.Command.DispatchID(Int32 id)
à System.Windows.Forms.Control.WmCommand(Message& m)
à System.Windows.Forms.Control.WndProc(Message& m)
à ᝸.ᜁ.ᜊ(Message& A_0)
à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
 
.NET Reflector 5.1.4.0
.NET Framework 2.0.50727.1434
Microsoft Windows NT 6.0.6001 Service Pack 1
Culture: fr-FR (fr-FR)
 
 
[AddInManager]
"C:\techbox\dotnet\Reflector\CodeMetrics\Reflector.CodeMetrics.dll"
"C:\techbox\dotnet\Reflector\FileDisassembler\Release\Reflector.FileDisassembler.dll"
"C:\techbox\dotnet\Reflector\ExceptionFinder\ExceptionFinder.dll"
 
[AssemblyCache]
"%SystemRoot%\Microsoft.net"
"%ProgramFiles%\Reference Assemblies"
"%ProgramFiles%\Microsoft.net"
"%ProgramFiles%\Microsoft Silverlight"
Closed Nov 25, 2008 at 5:52 AM by jasonrbock
I just added a test to the code base called ThrowCustomException. It passes as expected. I also ran the analyzer against that code and the custom exception works fine. I'm not sure what is causing the error you're seeing but it doesn't seem to be specific to custom exceptions.

comments