Camillia
asked on
Anyway to ignore unhandled errors in config file?
I'm developing an app using both SQL Server and IBM provider.
I'm getting this error and seems like it's from IBM and we need to get a hotfix from them. Until then, is there a way to catch/ignore unhandled exceptions in App.Config (i'm using windows console).
Code works fine , just get the error at the end. Need to ignore the error until we get the hotfix.
This thread talks about the error and mentions below but i dont see that legacy option. I added it but got an error.
<runtime>
<legacyUnhandledExceptionP olicy enabled="1"/>
</runtime>
I'm getting this error and seems like it's from IBM and we need to get a hotfix from them. Until then, is there a way to catch/ignore unhandled exceptions in App.Config (i'm using windows console).
Code works fine , just get the error at the end. Need to ignore the error until we get the hotfix.
This thread talks about the error and mentions below but i dont see that legacy option. I added it but got an error.
<runtime>
<legacyUnhandledExceptionP
</runtime>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Does it post an exception name? If so what is it.
ASKER
i thought i posted the link , i hadnt:
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=115170
Error is :
System.ObjectDisposedExcep tion was unhandled
Safe handle has been closed
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=115170
Error is :
System.ObjectDisposedExcep
Safe handle has been closed
Hi Farzadw;
If you structure your console application like this then you should not get the error being displayed.
Fernando
If you structure your console application like this then you should not get the error being displayed.
Fernando
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication3
{
class Program
{
private static void DoTheRealWorkHere()
{
// Do you real work here
}
static void Main(string[] args)
{
try
{
DoTheRealWorkHere();
}
catch (Exception ex)
{
}
}
}
}
ASKER
let me try it.
ASKER
tried it and still throws the error. I havent applied IBM's fix. I'm using this code for the Data Access layer
http://aspalliance.com/837
and there's no try-catch in his code. I think the error is from IBM's provider when it connects or something (i read something like that).
I**** got a more detailed error:
Unhandled Exception: System.ObjectDisposedExcep tion: Safe handle has been closed
at System.Runtime.InteropServ ices.SafeH andle.Dang erousRelea se()
at System.Threading.Registere dWaitHandl eSafe.Fina lize()
Which lead me to this site:
http://msdn2.microsoft.com/en-us/library/system.runtime.interopservices.safehandle.dangerousrelease(VS.80).aspx
Wonder if I need to code for safe handle.
*** told my manager about the fix and he's in la la land somewhere. If I could get around it with code, that would be great. Otherwise, he needs to deal with it.
http://aspalliance.com/837
and there's no try-catch in his code. I think the error is from IBM's provider when it connects or something (i read something like that).
I**** got a more detailed error:
Unhandled Exception: System.ObjectDisposedExcep
at System.Runtime.InteropServ
at System.Threading.Registere
Which lead me to this site:
http://msdn2.microsoft.com/en-us/library/system.runtime.interopservices.safehandle.dangerousrelease(VS.80).aspx
Wonder if I need to code for safe handle.
*** told my manager about the fix and he's in la la land somewhere. If I could get around it with code, that would be great. Otherwise, he needs to deal with it.
Sorry but I have not used this configuration before and can not help in this matter.
ASKER
Getting the hotfix . I'll see if that would fix it.