Exception: System.Reflection.TargetInvocationException Exception has been thrown...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sad Smile
    New Member
    • Dec 2012
    • 2

    Exception: System.Reflection.TargetInvocationException Exception has been thrown...

    hi everybody,

    I get This Error In my Application After Running it for period and I don't know whats the reasons of this

    here is the Error :-

    Exception: System.Reflecti on.TargetInvoca tionException

    Exception has been thrown by the target of an invocation.

    Exception: System.Componen tModel.Win32Exc eption

    The operation completed successfully


    Exception: System.Reflecti on.TargetInvoca tionException
    at System.RuntimeM ethodHandle._Se rializationInvo ke(Object target, SignatureStruct & declaringTypeSi g, SerializationIn fo info, StreamingContex t context) at System.Reflecti on.RuntimeConst ructorInfo.Seri alizationInvoke (Object target, SerializationIn fo info, StreamingContex t context) at System.Runtime. Serialization.O bjectManager.Co mpleteISerializ ableObject(Obje ct obj, SerializationIn fo info, StreamingContex t context) at System.Runtime. Serialization.O bjectManager.Fi xupSpecialObjec t(ObjectHolder holder) at System.Runtime. Serialization.O bjectManager.Do Fixups() at System.Runtime. Serialization.F ormatters.Binar y.ObjectReader. Deserialize(Hea derHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomai n, IMethodCallMess age methodCallMessa ge) at System.Runtime. Serialization.F ormatters.Binar y.BinaryFormatt er.Deserialize( Stream serializationSt ream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomai n, IMethodCallMess age methodCallMessa ge) at System.Resource s.ResourceReade r.DeserializeOb ject(Int32 typeIndex) at System.Resource s.ResourceReade r.LoadObjectV2( Int32 pos, ResourceTypeCod e& typeCode) at System.Resource s.ResourceReade r.LoadObject(In t32 pos, ResourceTypeCod e& typeCode) at System.Resource s.RuntimeResour ceSet.GetObject (String key, Boolean ignoreCase, Boolean isString) at System.Resource s.RuntimeResour ceSet.GetObject (String key, Boolean ignoreCase) at System.Resource s.ResourceManag er.GetObject(St ring name, CultureInfo culture, Boolean wrapUnmanagedMe mStream) at System.Resource s.ResourceManag er.GetObject(St ring name) at OceanTools.Ocea nErrorForm.Init ializeComponent () in D:\Last work\2010\My Test OceanTools Underground Working\Forms\O ceanErrorForm.D esigner.vb:line 160 at OceanTools.Ocea nErrorForm..cto r() in D:\Last work\2010\My Test OceanTools Underground Working\Forms\O ceanErrorForm.v b:line 61 at App1.My.MyAppli cation.MyApplic ation_Unhandled Exception(Objec t sender, UnhandledExcept ionEventArgs e) in D:\Last work\2010\The One Master\Applicat ionEvents.vb:li ne 94 at Microsoft.Visua lBasic.Applicat ionServices.Win dowsFormsApplic ationBase.raise _UnhandledExcep tion(Object sender, UnhandledExcept ionEventArgs e) at Microsoft.Visua lBasic.Applicat ionServices.Win dowsFormsApplic ationBase.OnUnh andledException (UnhandledExcep tionEventArgs e) at Microsoft.Visua lBasic.Applicat ionServices.Win dowsFormsApplic ationBase.OnUnh andledException EventAdaptor(Ob ject sender, ThreadException EventArgs e) at System.Windows. Forms.Applicati on.ThreadContex t.OnThreadExcep tion(Exception t) at System.Windows. Forms.Control.W ndProcException (Exception e) at System.Windows. Forms.Control.C ontrolNativeWin dow.OnThreadExc eption(Exceptio n e) at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows. Forms.UnsafeNat iveMethods.Disp atchMessageW(MS G& msg) at System.Windows. Forms.Applicati on.ComponentMan ager.System.Win dows.Forms.Unsa feNativeMethods .IMsoComponentM anager.FPushMes sageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows. Forms.Applicati on.ThreadContex t.RunMessageLoo pInner(Int32 reason, ApplicationCont ext context) at System.Windows. Forms.Applicati on.ThreadContex t.RunMessageLoo p(Int32 reason, ApplicationCont ext context) at System.Windows. Forms.Applicati on.RunDialog(Fo rm form) at System.Windows. Forms.Form.Show Dialog(IWin32Wi ndow owner) at System.Windows. Forms.Form.Show Dialog() at App1.SplashScre en1.SplashScree n1_FormClosed(O bject sender, FormClosedEvent Args e) in D:\Last work\2010\The One Master\SplashSc reen1.vb:line 85 at System.Windows. Forms.Form.OnFo rmClosed(FormCl osedEventArgs e) at System.Windows. Forms.Form.WmCl ose(Message& m) at System.Windows. Forms.Form.WndP roc(Message& m) at System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m) at System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m) at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    Exception: System.Componen tModel.Win32Exc eption at System.Drawing. Icon.Initialize (Int32 width, Int32 height) at System.Drawing. Icon..ctor(Seri alizationInfo info, StreamingContex t context)
    any help !

    thanks
    Last edited by PsychoCoder; Dec 16 '12, 09:32 PM. Reason: Formatted error message
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    Someone else will catch something; however, looks like you exceeded the max thread count or tried to re-enter a portion of your program that was "locked."
    The other thing that greatly bothers me is the unsafenativemet hods.dispatch and cross-application-domain... just what was your program trying to do that triped that!

    Me thinks you're going to have to tell us what your program is supposed to do before either anyone can or will help you.

    Comment

    • Sad Smile
      New Member
      • Dec 2012
      • 2

      #3
      hi zmbd ,

      thanks for replay

      this form is just for adding order or bill in

      database(sqlser ver)

      and this error rise in button "add " click event

      Comment

      • zmbd
        Recognized Expert Moderator Expert
        • Mar 2012
        • 5501

        #4
        I would not expect the form's code to throw these errors if done according to best practices.

        Without your code, I don't see how anyone will be able to provide specific help; however, you should go in and look at how you are calling the form and what resources the form is using once open. Finally, what is happening during the close of your form to those resources. You also need to take the same look over the click_event of the "Add" button.

        Please read the FAQ and posting guidelines before posting your code and make sure to use the <CODE/> button to format it. :)

        Comment

        Working...