[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Unhandled WIN32 execption

Posted on 2012-08-31
10
Medium Priority
?
1,365 Views
Last Modified: 2012-08-31
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
0
Comment
Question by:peer754
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 38353451
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
 

Author Comment

by:peer754
ID: 38353467
No, I can't find anything in the logs that I can relate to my application sorry.
0
 

Expert Comment

by:Prophion
ID: 38353527
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 45

Expert Comment

by:AndyAinscow
ID: 38353549
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
 

Author Comment

by:peer754
ID: 38353563
@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
 
LVL 12

Accepted Solution

by:
rajapandian_81 earned 2000 total points
ID: 38353576
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
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 38353600
>>@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
 

Author Comment

by:peer754
ID: 38353619
Thanks rajapandian_81 I got this Exception:
System.Management.ManagementException: User credentials cannot be used for local connections
0
 

Author Closing Comment

by:peer754
ID: 38353639
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
 
LVL 12

Expert Comment

by:rajapandian_81
ID: 38353711
Glad to know you have solved the issue :)
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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question