Results 1 to 5 of 5

Thread: System.Reflection.TargetInvocationException' occurred

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2006
    Posts
    4

    System.Reflection.TargetInvocationException' occurred

    Can somebody help me fix this problem? I have a child form that opens on a button click event within my main form using frmMyForm.show(). It works fine the first time, but after I close the child form and try try to open it again, I get the following error:

    An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,173

    Re: System.Reflection.TargetInvocationException' occurred

    It's easy to accomplish this, so you must be doing something in your code that is causing this. Post your code. All relevant parts of it, that is.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2006
    Posts
    4

    It works now

    I was having a late night brain freeze placing my object as a class member instead of local to the routine. Thanks anyway.
    Last edited by Tom Hannah; Jan 20th, 2006 at 07:41 AM.

  4. #4
    New Member
    Join Date
    Sep 2009
    Posts
    3

    Re: System.Reflection.TargetInvocationException' occurred

    I am also getting the similar error.TargetInvocationExceptionthrown.
    at {return (IPetShopCacheDependency)Assembly.Load(path).CreateInstance(fullyQualifiedClass);} for my class DependencyAccess.cs of the MS Petshop4 application.

    I tried referring http://support.microsoft.com/kb/828991 and set the gacutil for the PetShopCacheDependency.dll and it was succesfully created in its directory.I tried executing it again but still it thrws error.Please suggest and rectify me if I am doing wrong steps!

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,302

    Re: System.Reflection.TargetInvocationException' occurred

    That looks an awful lot like C# code. This is the VB.NET forum. If you think the question is language independent then it belongs in .NET A & D.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width