0

Here is my problem:

  • I've created a little app to communicate with a server, nothing much particular. I'd like to publish it so I can give the app to my friends but after being published, I click the setup, it asks me to install, and after a few seconds, closes and nothing happens.
  • I've tried to "publish" the app with a Setup project, it installs and when I try to open the app, nothing happens.

I looked for solutions but nothing worked for me. Do you have any ideas?

The programm is under Visual Studio 2019, .NET 4.7.2

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291

2 Answers2

0

This could be related to different reasons, like lack of runtime ( .NET framework runtime ) on target machines or application behavior as well ( you did not tell much about it).

You could use some logging framework like NLogger or Log4Net to save in a log file at least critical errors and warnings so that you could see on target machine directly what the issues are.

in general if you properly used a setup project that should make sure your installer checks for dependencies like .NET runtime and also creates a desktop shortcut,

if you are publishing via ClickOnce you can easily specify in there to create a desktop icon and to include or download pre-requisites during installation phase.

Are you sure the issue is not related to exception handling and some failure happens when application started and tried to communicate with your server and for whatever network setting or reason fails to do so and then silently crashes?

Davide Piras
  • 43,984
  • 10
  • 98
  • 147
  • 2
    Well, .NET frameworks should be ok, I've checked and they're good. I'll try to use logs frameworks to check everything out and yeah, my installer checks for dependencies during installation. I'm not using ClickOnce for publishing so, I don't know :/ Pretty sure it isn't related to exception handling cause at the start of the app, only the form should pop, nothing else, so that would be strange that the program fails at opening the form – Cyril Krzyzowski Oct 28 '19 at 13:06
0

If you try to connect to the server at the initialization of your program (form_load, etc.), it can happen when the connecting to the server fails. The whole application waits to reach a timeout, which may be 30 seconds long. Please check this scenario. See if the server is available and connectable.

  • Connection only happens after clicking a button, on start only the Form appears :/ – Cyril Krzyzowski Oct 28 '19 at 13:02
  • Try run on debug mode and see what is happening on the program start. And share more information on where it waits. – Farhad Rahmanifard Oct 28 '19 at 13:04
  • Either on debug or in release mode, the application starts well (as you can see https://imgur.com/xw07yX2 ) same goes when I'm running it from VS, but when published or when installer thanks to the project installer, nothing happens – Cyril Krzyzowski Oct 28 '19 at 13:09
  • Did you install it on your computer? Does It not work after installation even on the development computer? – Farhad Rahmanifard Oct 28 '19 at 13:14
  • Yeap, either on dev computer or friend's computer, it doesn't work after installation – Cyril Krzyzowski Oct 28 '19 at 13:15
  • It's interesting. Some 32bits/64bits issues can create similar behavior, but most of them are detectable during the test of the release version. Check if all your dependencies and projects in the solution are in the same build platform (32 or 64). Anyway, I don't think that it causes your problem here. – Farhad Rahmanifard Oct 28 '19 at 13:28
  • Yes, they're :/ I've tried to change "target platform" aswell, but nothing changed... – Cyril Krzyzowski Oct 28 '19 at 13:32
  • It should be an obvious problem that is hardly detectable. Please check the installation creation process step by step. Also, suggest trying third-party install creators. – Farhad Rahmanifard Oct 28 '19 at 13:46
  • Yeah, it probably is... I'm going to check the installation but I already looked once and it looked ok, thanks for the help tho – Cyril Krzyzowski Oct 28 '19 at 13:48
  • this is happening in most cases and looks like some bug from Microsoft hope they fix it and if you find the solution do share it with us – oliva nikita Oct 14 '22 at 19:41