Unhandled WIN32 execption

Hi,

I'm runnin a console app developed using c# in VS2010 .NET FW 4.0 on my local XP SP3 machine without problem. The app is querying some servers using WMI through RDP.
My admin account is running the task and has been added in all servers for access rights etc.

However, when I try to run the very same app on a Windows 2003 machine I get a runtime error An unhandled WIN32 execption occured in myapp.exe [4144].

I've run Dependency check to verify that all dll's are loaded etc. What else can cause this?
Where do I search next?

What more info do you need to help me with this?

BR
Peer
peer754Asked:
Who is Participating?
 
rajapandian_81Connect With a Mentor Commented:
Hi,

Can you catch the error in UnhandledException event handler and log the error in a file. Then we can proceed based on the error.

Refer "Global Exception Handling in a .NET console application or Windows Service" in the following link:
http://www.roelvanlisdonk.nl/?p=591
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
I guess you have made an assumption - one that works on your machine BUT doesn't on the Win 2003 machine.

Is there anything in the event logs for the PC ?
0
 
peer754Author Commented:
No, I can't find anything in the logs that I can relate to my application sorry.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
ProphionCommented:
You could use a try() and catch() block to retrieve the failure exception. Maybe your WMI on the server needs a hotfix.

Alternatively you could use the .NET framework instead of the WMI.
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
Can you 'localise' the exception.  By that I mean if it always happens when you press button X or on your PC form Y is shown but the exception happens before you see form Y on the win 2003 machine.
If you can then it means less code for you to inspect.
0
 
peer754Author Commented:
@AndyAinscow: There is no Form, this is a console application that runs without shell
@Prophion: If you want I can send you the code, but I need to take away some company secrets such as username, password servername etc first? I have try - catch blocks on all WMI calls allready.
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
>>@AndyAinscow: There is no Form, this is a console application that runs without shell

OK, but no output to help you track down whereabouts the error might happen?   Could you write to a file some simple TRACE statements to help localise the problem ?
0
 
peer754Author Commented:
Thanks rajapandian_81 I got this Exception:
System.Management.ManagementException: User credentials cannot be used for local connections
0
 
peer754Author Commented:
I found out why, one of the servers that is included in the server list is the very same that my app is running on. When doing the WMI connection I provide username + password even though it's the LOCAL machine :-o
0
 
rajapandian_81Commented:
Glad to know you have solved the issue :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.