المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : 64bit woes



C# Programming
08-23-2009, 01:14 PM
Hi folks!

I have a strange behaviour I cannot explain, perhaps someone who's deep into 64bit development can enlighten me?

I have 2 applications written in C#: A main app (A) and an additional program for updates (U). When A is started and there's something to update, A starts U (using System.Diagnostics.Process) and quits. U in turn updates A's files and restarts A afterwards. So far, so simple. Worked for years (on 32bit Windows) without problems.

Now recently while doing some testing on Win7RC 64bit I discovered that the automatic update fails. When there's something to update, Windows tells me after a while that U doesn't work anymore and kills it (leaving an exception in Kernelbase.dll in the event log).

After some debugging I found that U hangs as soon as I try to show a non modal dialog containing at least one control (using new Form().Show(); showed the empty dialog OK and didn't hang). When I modified U's status dialog to add all controls inside its Load event and not already inside InitializeComponent(), the Updater hangs when I add the first control to the Form's Controls collection. http://www.barakasoft.com/script/Forums/Images/smiley_confused.gif

A was compiled with x86 as target (because I need to use 32bit third-party COM objects) and U with AnyCPU (because it didn't have any specific external dependencies I thought it doesn't matter which processor architecture it's compiled for), thus running as 64bit application on a 64bit OS.
After switching U to x86 as well it worked, but I still don't know why!

With A being x86 and U being AnyCPU I can't even get a MessageBox to show (although the call to MessageBox.Show() doesn't hang the application).

Unfortunately I don't have the faintest idea what's going on here. Does anyone have a clue?

Thanks in advance,
mav

--
Black holes are the places where God divided by 0...