Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF application slow on startup

Tags:

My WPF application currently only shows a screen with some controls, it doesn't connect to DB or has any other functionality. It's a simple UI screen.

When I was testing in some computers (WinXP SP2), I've detected that it took more than 15 seconds to startup. They were all in our domain.

I've grabbed a similar computer, only with Windows installed, and the application took 2 seconds to startup.

Then I added the computer to our domain, and testing it with a domain user showed that it also took 15 seconds to startup. I tested again with the previous user (local user) and it's still fast. I created another local user, but it takes the 15 seconds that the domain user also takes. I've added other local users but they were also slow.

To summarize: the application starts fast (2 sec) in only one user, the first one I tested. All other users (domain or local) are slow (15 sec).

I've been checking Improving WPF applications startup time but my problem seems to need a different approach. Does anyone figure out what can be happening?

like image 901
Nelson Reis Avatar asked Jul 06 '09 12:07

Nelson Reis


2 Answers

I found another solution to this problem in this documentation from Microsoft.

Adding the following configuration to the app.config file will also solve the problem:

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

This way, you don't need to change computer configurations. It's just configuration of the application.

UPDATE:
Seems that .NET 4.0 fixed this issue, as documented here on MSDN.

like image 88
Nelson Reis Avatar answered Sep 18 '22 14:09

Nelson Reis


Is the system connected to a network, but cannot reach the internet because the proxy is not configured? If so, go to Internet Settings (i.e. Internet Explorer Properties), Advanced, and look in the tree view for Security and a checkbox like "check revoked certificates" or something (I'm using German Windows, so I don't have the English label at hands). Uncheck and test again.

If this fixed the problem, you have one signed assembly that is not from Microsoft for which the .NET Framework will check for revocations, and time out after 15 seconds. If you disable the checking or configure the internet connection properly, you won't have to wait.

like image 27
OregonGhost Avatar answered Sep 17 '22 14:09

OregonGhost