views:

190

answers:

3

I'm developing a .Net 2.0 application using DevStudio 2005 and running on a Windows XP machine. On my machine, which is up to date with all the automatic updates, the release version runs OK. If I run the application on a vanilla XP SP2 machine (i.e. freshly installed OS with no updates) it hangs with 99% CPU usage. It's hanging at the point the application is going to load some language (translated text) based assemblies. Before anyone says "get all the updates" I'm afraid this is not an option since the machines the application runs on are not usually connected to the internet - they're bank note sorting machines, and bank IT departments really don't like installing new code on their machines.

So, does anyone know what might cause a .Net 2.0 application to work OK on one XP PC but not on an older XP PC? I'm guessing there's been an update to the .Net Framework which is causing these problems but I haven't been able to pinpoint the source of the incompatibility.

UPDATE:

I've set up remote debugging and stopped the process when it hangs and the function on the top of the call stack is "ntdll.dll!_RtlCompareMemoryUlong@12() + 0x10 bytes" which is called by "RtlFreeHeapSlowly" (not sure why I'd want to free something slowly).

Another Update:

It seems the PC that built the application that hangs has Dev Studio SP1 and a few security updates installed. My machine doesn't have SP1 installed and if I build it the application works fine on the target PC. I don't think it's a .Net Framework issue as I have updates to the framework whereas the target PC has a fresh install of the framework. Unfortunately, we can't install Dev Studio SP1 on the target PC as they don't have Dev Studio installed. Is there any way to find out what dependencies require updating?

+2  A: 

Try installing .NET 2.0 SP1 /SP2 framework along with your Application (i.e bundle updated .NET framework installer with your application.) This way you will not be dependent on the customer to do a complete Windows Update just to run your application.

Ganesh R.
This appears to be the answer, although it would be useful to know what update caused the problem.
Skizz
Actually, it wasn't the framework at all.
Skizz
vcredist_x86.exe is not required for .NET applications. Are you using un-managed code ? If yes then vcredist_x86.exe is required.
Ganesh R.
+1  A: 

If you can access the machine whilst it is running with 99% CPU usage you could use ProcMon from SysInternals to see where it's spending all its time.

Matt Warren
+1  A: 

Does "hang" mean it hangs permanently, or does it just take a long time (15 seconds per assembly you are loading)? If the latter and the PCs are connected to a network, but don't have internet access, try disabling the "check for certificate revocations" thing in Internet Explorer options. If that solves the problem, you can either require that option to stay disabled, or disable the generatePublisherEvidence setting in the application configuration.

If it hangs permanently, well, then this answer does not apply to you :)

OregonGhost