• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

TargetInvocationException on Deployment

I have a weird issue that I'm trying to sort out and I'm wondering if anyone has any similar experiences to give me a lead.

A Windows app I developed runs fine locally, on my notebook (second computer) at home, and on my friend's machine apparently, but when I try to open the file at work to use it to perform an assigned task I get:


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

Additional information: Exception has been thrown by the target of an invocation.




I tried to see if I was including files on one machine that I wasn't on another and apparently they use the same stuff. Are there any circumstances where I'd get such an error on one machine and not another?
0
boulder_bum
Asked:
boulder_bum
3 Solutions
 
Razzie_Commented:
I believe this is an 'old' bug in the 1.0 Framework, but dunno if it occurs in 1.1 as well. This should be fixed when installing the latest service packs for the .NET framework. So my guess is the other machines have a certain Service pack installed, and this one machine hasn't.

HTH,

Razzie
0
 
boulder_bumAuthor Commented:
Good guess! Definately a useful bit of info.

Unfortunately (or fortunately), all the machines look up-to-date on the patches.
0
 
tomvergoteCommented:
maybe this KB is any help
http://www.kbalertz.com/kb_828991.aspx
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
JigitCommented:
boulder_bum, sometimes the above exception is caused by calling to a COM object. InnerException property holds the real exception with its description. So write to Event Log inner exception and see what was the problem. It was written in notepad and was not tested.

try{ //your code
}
catch( Exception e)
{
    string errorMessage = null;
    if ( e.InnerException == null )
      errorMessage = e.Message;
    else if ( e.InnerException.InnerException == null )
              errorMessage = e.InnerException.Message;
           else errorMessage = e.InnerException.InnerException.Message;

    // Write errorMessage to Event Log
}

HTH,
Jigit
0
 
boulder_bumAuthor Commented:
I ended up e-mailing myself the entire solution and it turns out that my subclassed LicenseManager tried to reference a file that got created after a certain point in processing. The issue didn't show up before because I didn't license the class until a recent build.

Why a FileNotFoundException wasn't thrown is a little puzzling to me, but at least it works now.

Razzie and Jigit got the bigger points because I thought the answers were most likely to help, but I appreciate your effort, Tom, so props to you, too.
0
 
Razzie_Commented:
Sorry it wasn't THE answer you were looking for, but glad you got it all figured out anyway :)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now