Pal. The standard way to figure this out is to actually evaluate what the
Exception
is telling you. In debug builds, it will contain a reliable StackTrace, and if you print it out with
.ToString()
you get the details of exactly which line failed. So, in your Exception handler, add the following code (assuming that you've called your
Exception
variable
ex
).
try
{
... exception is thrown here.
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
}