views:

161

answers:

1

I have big application (190 MB in 600 files) deployed using clickonce 3.5. After installation of this application i run it from link located in Start Menu but it takes over 4-12 sec to show my Splash Screen. When this application is run from .exe file Splash screen is visible after 1 sec. My application don't use automatic updates (Clickonce update is done manually from source code)

I've try to profile this application using dotTrace to find out what takes so long during startup and find out that

IActContext System.Deployment.Internal.Isolation.IsolationInterop.CreateActContext(IDefinitionAppId)

takes a lot of time

Here is entire subtree:

36,71% SetDomainManager - 12972 ms - 0 calls - System.AppDomain.SetDomainManager(Evidence, Evidence, IntPtr, Boolean)
  18,52% CreateActivationContext - 6542 ms - 0 calls - System.Deployment.Internal.Isolation.Manifest.CmsUtils.CreateActivationContext(String, String [], Boolean, ApplicationIdentity &, ActivationContext &)
    18,52% ActivationContext..ctor - 6542 ms - 0 calls - System.ActivationContext..ctor(ApplicationIdentity)
      18,52% CreateFromName - 6542 ms - 0 calls - System.ActivationContext.CreateFromName(ApplicationIdentity)
        18,52% CreateActContext - 6542 ms - 0 calls - System.Deployment.Internal.Isolation.IsolationInterop.CreateActContext(IDefinitionAppId)
  18,19% SetupApplicationHelper - 6429 ms - 0 calls - System.AppDomain.SetupApplicationHelper(Evidence, Evidence, ApplicationIdentity, ActivationContext, String [])
    18,19% DetermineApplicationTrust - 6429 ms - 0 calls - System.Security.HostSecurityManager.DetermineApplicationTrust(Evidence, Evidence, TrustManagerContext)
      18,10% get_ActivationContext - 6396 ms - 0 calls - System.Runtime.Hosting.ActivationArguments.get_ActivationContext()
        18,10% CreateFromName - 6396 ms - 0 calls - System.ActivationContext.CreateFromName(ApplicationIdentity)
          18,10% CreateActContext - 6396 ms - 0 calls - System.Deployment.Internal.Isolation.IsolationInterop.CreateActContext(IDefinitionAppId)
      0,09% DetermineApplicationTrustInternal - 33 ms - 0 calls - System.Security.Policy.ApplicationSecurityManager.DetermineApplicationTrustInternal(ActivationContext, TrustManagerContext)

How can i reduce this start time of my application? This is very critical because sometimes user has to wait over 12 secs to see Splash Screen

+1  A: 

It looks like a good portion of the time is spent determining the trust level of your application. Have you tried deploying this application with full trust to see if that will shave down the time?

JaredPar
Ok, I have full trust in my application manifest.
Irek
Startup time is the same. Nothing changed.
Irek