How to optimize WPF application startup on Windows startup

I implemented the WPF application and registered it to run when Windows started. My application is a simple login application that, when a user logs in, appears in the icon bar. The problem is that after starting Windows it takes about 30 seconds. I tried Ngen without much success. I would like to avoid the implementation of the splash screen. I want my WPF application to appear “right away” after starting Windows, similar to what Windows Live Messenger does. What can I do to reduce startup time? I have another choice but to encode it initially? Thank.

+5
source share
4 answers

Will it start another 30 seconds when the computer is in standby mode (for example, if you start it by double-clicking when the computer is not busy loading windows)?

When Windows starts, the computer is usually busy with a lot of things, and this can cause a slowdown for your application. Not much you can do.

But some general tips for improving the launch of a WPF application:

  • Create an instance of the controls that you really need to show the user.
  • Reduce the complexity of your controls / windows.
  • Do not spend much time in the designers of your controls and windows.
    • Even innocent things, such as reading a file from a local disk, can take a long time if the disk is busy with other things (as is usually the case when starting Windows)
    • - , .
    • - BackgroundWorker / .

, app.config, , ( , ):

<configuration>
  <runtime>
    <generatePublisherEvidence enabled="false"/> 
  </runtime>
</configuration>

- MSDN .

+2

, . , ( ) Windows. , .

0
0

regedit, DWORD

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Serialize

StartupDelayInMSec.

0, .

10 .

Note: the Serialize key may not exist.
You can create it by right-clicking Explorer and choosing New -> Key

0
source

All Articles