Reputation: 51
I implemented a WPF app and had it registered to launch at windows startup. My app is a simple logon app which when the user is logged on appears in the icon tray.The problem is that it takes about 30 seconds to show itself after Windows startup. I've tried Ngen without great success. I would like to avoid implementing a splash screen. I would like my WPF app to appear "immediately" after Windows startup similar to what Windows Live Messenger does. Anything I can do so as to reduce its startup time? Do I have any other choice than to code it natively? Thanks.
Upvotes: 5
Views: 1705
Reputation: 1165
Using regedit, Create a DWORD in the registry at
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Serialize
called StartupDelayInMSec.
Default value should be set to 0, but double check.
This cut about 10 seconds off for my application launch time after startup.
note: The Serialize Key may not exist.
You can create it by right-clicking on Explorer and selecting New -> Key
Upvotes: 0
Reputation: 35884
Does it also take 30 seconds to start when the computer is idle (i.e if you start it by double clicking when the computer is not busy loading windows)?
During windows startup, the computer is typically busy with a lot of stuff and that could cause slowness for your application. Not much you can do then.
But, some general tips for improving startup of a WPF application:
BackgroundWorker
or use asynchronous calls to do I/O and network requestsThere is also a setting you can put in app.config
that tells the runtime to not authenticate the assemblies with the certificate (this check can take a long time, especially cold starts):
<configuration>
<runtime>
<generatePublisherEvidence enabled="false"/>
</runtime>
</configuration>
Some more general tips are available on the MSDN site on Application Startup Time.
Upvotes: 2