GorillaApe
GorillaApe

Reputation: 3641

C# WPF really slow startup first time

I was adviced to just create a simple wpf application with a button to check the performance problems..
It is painfully slow to start only first time event in decent machines. I have built an executable in release mode optimised but first time is about 15 seconds disk IO is high during that time.. The second time it runs is faster less than 1 sec...
I believe that it is too much time...

I added a file app1.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <runtime>
    <generatePublisherEvidence enabled="false"/>
  </runtime>
</configuration>

app1 isnt the name of the app.. but didnt help...

Any idea what to do ??

Upvotes: 5

Views: 6239

Answers (2)

CodeNaked
CodeNaked

Reputation: 41393

You may be able to use NGen to speed up the first run of your application.

Upvotes: 0

Ed Bayiates
Ed Bayiates

Reputation: 11210

On some machines if you've never run a WPF app since bootup the application startup can be painful. You could add a "quickstart" by running any WPF app (without needing to display a window -- just reference one) in your startup folder. That will ensure the dot-net framework is fully loaded and your app should load faster, though this will slow bootup a bit.

Upvotes: 4

Related Questions