0

I develop .NET application for a 6 years but today I faced with really strange behavior.

After I copy my application files (.exe, .dll, configs etc.) onto another machine I found that double click on .exe file deadly hangs the app. Waiting cursor never disappear.

After some time I installed VS 2012 express on that machine and started my project. It starts and runs perfectly. After this I tried to run its' .exe file from ../bin/debug folder. It hangs like the first time.

After this I created empty WPF application. The story repeated itself completely: it perfectly starts from VS but deadly hangs when start from direct exe double click.

So, any (WPF) application starts correctly under VShost but hangs when started from exe file. May be someone have some ideas about what may going on on this computer?

Serge P.
  • 327
  • 1
  • 3
  • 16
  • What version of Windows are you running (both computers)? – RQDQ Jun 09 '16 at 19:47
  • Why are you deploying the debug version? – Ken White Jun 09 '16 at 19:48
  • 1
    Are you running from a share drive or a local folder on your machine? – Jason Jun 09 '16 at 19:49
  • I have deployed WPF .EXE files (RELEASE version) as standalone and work perfectly for me – Camilo Terevinto Jun 09 '16 at 19:49
  • I tried also release version. All the same – Serge P. Jun 09 '16 at 19:50
  • this smells of some configuration (VS) or machine setup issue, do you have any setup 'out of ordinary', low on space something. Are you running through RD (doesn't seem relevant just asking). And did you try some other apps, exe etc., anything .NET. Also I assume you restarted the machine. – NSGaga-mostly-inactive Jun 09 '16 at 20:03
  • Machine restarting is the only way to get rid of hanged instances in my case. Task Manager for some reason can not kill it. Other apps seem to run fine. Fails only created with VS (sounds crazy but it is what I have) – Serge P. Jun 09 '16 at 20:10
  • This type of error ('breakpoint' message you mentioned) is often related to some sort of memory corruption (though could be many things) - and e.g. with C++ - but since you have an empty .NET not sure (maybe again look elsewhere, reinstall some things, VS at least - also look at what is installed at your machine that could interfere). Btw how do you run the VS and explorer (you're clicking from) - as a normal user each time, admin, how is that you're logged in? Though again that's a long-shot. – NSGaga-mostly-inactive Jun 09 '16 at 20:19
  • @SergeP.when you have more people in comments you need to tag them specifically so they get the notification (start with @...) – NSGaga-mostly-inactive Jun 09 '16 at 20:21
  • Try downgrading the dotnet version you use. Just a suggestion. – LosManos Jun 09 '16 at 20:25
  • 1
    Related: http://stackoverflow.com/questions/9066930/wpf-window-crashes-on-startup-or-it-starts-but-hangs-and-does-not-render-conten – RQDQ Jun 09 '16 at 20:32

2 Answers2

0

Some things you could check:

  • Do you have any System.Diagnostics.Debugger.IsAttached checks in your code?
  • Could the current directory cause any differences in behaviour; remember that if you launch VS then you're program will run from there.
  • Do you have any tracing in your code; if so, does that give you any information about what the program is trying to do before it hangs?
Paul Michaels
  • 16,185
  • 43
  • 146
  • 269
  • I have no Tracing/Debugging or anything else in my code. Actually I have nothing - just create blank WPF application and try to start it from VS (OK) and by double clicking (Hang). – Serge P. Jun 09 '16 at 19:57
  • What configuration are you running? Also, is this on any PC, or just one? – Paul Michaels Jun 09 '16 at 19:59
  • The hanging process does not display in regular Task Manager but it does in VS 'Attach To' processes list. When I attach VS debugger to it, VS emits the message '..application has triggered a breakpoint...'. Then VS deadly hangs too – Serge P. Jun 09 '16 at 20:03
  • I tried different configurations: x64, x32, AnyCPU. The problem computer has 32-bit OS – Serge P. Jun 09 '16 at 20:04
  • Do you get the same behaviour with a winforms app? – Paul Michaels Jun 09 '16 at 20:45
0

I would try the following (requires Visual Studio onto the target machine and debug version assemblies, so it is kind of convoluted):

  • copy relevant sources onto target machine
  • start the application from exe in Debug (pdbs should also be there)
  • in Visual Studio, open the solution
  • attach to process (Ctrl-Alt-P) -> select your executable
  • pause the execution

Specifing Source Files in the Visual Studio Debugger might be required.

Of course, using a detailed logging via a logging library such as NLog, could also be helpful.

Alexei - check Codidact
  • 22,016
  • 16
  • 145
  • 164