tags:

views:

850

answers:

4

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?

A: 

Does it open up a file or interact in the network in some way? Because if not, I would suggest that whether or not you're logged into a domain or running as a local user is probably a red herring.

Are you building in debug or release mode? It's worth trying release mode if you've not already because running in debug does a load of extra error checking..

Jon Cage
The application is not interacting with the network or DB in any way. It simply opens a form with some controls in it. I'm building in release mode. Thanks.
Nelson Reis
A: 

Have you checked if there are any domain policies that can affect this scenario?

Magnus Johansson
I am currently looking for that, but still couldn't find any...
Nelson Reis
+3  A: 

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.

OregonGhost
This is a great answer! It fixed the problem! The computers that will have this application running won't have access to the Internet. Thank you very much!
Nelson Reis
+1: Nice spot Oregon!
Jon Cage
Great advice. But can this be configured in some other place, rather in the IE connection settings? I mean per application for example.
Magnus Johansson
@Nelson Reis: We encountered the problem when installing our application into a VM that has no Internet access. The funny thing is, if you unplug the ethernet cable (i.e. in VMWare disconnect the ethernet device), it works fine, because the system will recognize that there's no way to the Internet. @Magnus Johansson: I don't know, unfortunately. It's not a major issue for us, because the problem does not occur on systems in the field. Maybe there's a group policy setting so you can roll out it for your company, but I didn't find anything about disabling it just for the app.
OregonGhost
Adding to that, if I remember correctly, if Internet access is available during installation (i.e. while installing the signed assembly into the GAC), it will check at that point and not bother when starting the application, even if you disconnect later.
OregonGhost
@Magnus Johansson: Check my answer below. It will solve the problem without having to change any configuration in the computer.
Nelson Reis
@OregonGhost: I've discovered that you can change the configuration of the application to overcome this issue. Although your answer was very useful to me. Thanks.
Nelson Reis
+4  A: 

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.

Nelson Reis
Seems to be the solution, though to me it's not clear from the documentation whether this disables only the check for revocation, or other checks as well.
OregonGhost
Yes, you are right. For now I have these two options. Maybe later I'll try to check some more information about this.
Nelson Reis