Why doesn't my WPF application show up? - c#

I have a WPF application developed and been testing already for a few months.
When it's installed on the client's computer the application starts and no window is visible. The task manager shows the application is running.
The application is writing all activities in few log files and it looks like it is doing something but no visible screen.
What can be a possible cause of the problem ?
Why it is invisible on that specific machine ? The machine is Windows 7 64x bit
The installed frameworks are v1.0 1.1 v2.0 v3.0 v3.5 v4.030319
The strange thing is the application was working before.

You should check Windows Event log (Type eventvwr in run dialog or go to viewer by Computer Management dialog of Windows) to get info about the problem. The reason is most likely your application has an exception before your main window is opened. So you see that process is running in task manager but windows did not show up.
The reason in event log could be anything. May be your app requires a file in a specified path but not found. I meany anything that causes an except,on could be your problem.

Related

Windows Application Packaging project with Full Trust Process stays running after closing UWP app

I'm using the Desktop Bridge to create a Full-Trust UWP app so I can run cmd commands from my UWP app. I followed this tutorial and got everything working just fine. However I noticed that when closing the UWP or the trusted process (WinForms app in my case) or both the packaged project keeps running. The debug mode keeps running and I can see the process in my task manager. Is there something extra I have to do to avoid that?
Okay so it wasn't actually an issue. The app will stay running for 30 to 60 seconds then exit. I guess it's to save memory in case it gets launched right after closing. Don't quote me on that though.

Why can't I select "update after install" in clickonce WPF app?

I have published my .net 5.0 WPF application to a UNC network directory. From there I ran "setup.exe" to install the appliation on my computer. Then when I ran the application it showed the "verifying application requirements" dialog which then disappeared without launching the application.
Running the application directly from the exe from the UNC path works fine. I have investigated this and it looks like it might be a case of this issue here:
ClickOnce Application Won't Open
Which points to a solution of selecting thee "after the application starts" option in the "Application Updates" window. The problem is I can't select this. Clicking the radio button "After the application starts" shown in the image below does nothing:
Why can't I select this?
It turns out that the "After the application starts" option is no longer supported in after .NET Core 3.0:
https://learn.microsoft.com/en-us/visualstudio/deployment/choosing-a-clickonce-update-strategy?view=vs-2019
For .NET 3.1 and newer applications, checking updates before the application starts is the only update option supported.
This doesn't help me resolve the issue of why my clickonce application won't start but at least I know why this option is unavailable.

.appxbundle cannot modify the registry

I have this simple piece of code, adding my application to run when windows start. Works fine.
RegistryKey rk = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
rk.SetValue("my_app", Application.ExecutablePath);
Then I package it with a Windows Application Packaging Project, connect it to windows store, choose "Create App Packages.." and get the resulting .appxbundle.
Fine so far. I install it locally. (also installing the generated certificate (.cer) so I can install it at all.)
Once I start the installed app and click a button running the code above, nothing changes in the registry! It does not crash, I have a try..catch around the code. It just silently ignore it.
Running it from visual studio works fine, the registry gets updated.
Actually, all I want is the app to start when windows start, I am not particularly interested in how to achieve that, so any ideas are welcome!
Edit: I forgot to say the most important stuff: It is a Windows Desktop, Windows Forms App. It is not a UWP app, but a window inheriting an ordinary System.Windows.Forms.Form, compiled with x86.
Xavier mentions the StartupTask extension, it's a nuget package but it seems to be used when you have a UWP app.
Actually, all I want is the app to start when windows start, I am not particularly interested in how to achieve that, so any ideas are welcome!
You need to use the windows.startupTask Extension for your packaged UWP app. Please see Start an executable file when users log into Windows. With this extension, you can start your app whenever a user logs on.
Please note: The user has to start your application at least one time to register this startup task.

App not launching when started after Installation from Store

After installing my application from the Microsoft Store, a popup comes up and asks the user gets if he wants to start the installed appliation. However my application fails to start when launched this way. It does not have the same problem when launched directly or via the Start button inside the Microsoft Store applicaiton. The problem is i am not able to reproduce this scenario in my debuging flow. How can i debug this? Is this a known bug? I have not had this problem with other applications.
The image below shows the type of dialog that popus up after installation. When i click Starten (start). The application does not launch

ClickOnce windows application will not start

I have created a windows application using c# VS express 2012. The app works great in the VS environment. I have published the application using VS(ClickOnce) to the Desktop as an offline application, which does not check for updates. The app is not signed and security is disabled. The application seems to install fine when I run the setup.exe file. However, when I try to run the program from the start menu nothing happens. In the task manager, a process for the application appears for a few seconds then just goes away. The app window doesn't show and there aren't any indications of an error. If I navigate directly to the .exe of the app (%userprofile%\appdata\local\apps\2.0\%random id%......) and run it that way, it starts up and appears to function as designed. I've done some research and found that certain drivers and software (if installed) will cause this behavior (i.e. Kensington Mouse driver and Provencia software(?)). I've checked and I do not have either of these installed. Any help with this will be much appreciated.
Thanks in advance.

Categories

Resources