简体   繁体   中英

Slow application startup using ClickOnce deployment

we are deploying our application with ClickOnce and we noticed that when we start our application by clicking the ClickOnce desktop icon, the application start slower (it takes at least 30-60 seconds more) than while started directly from the .exe. I've seen that it's not an unkown issue ( Slow startup of Clickonce winforms application after update ) but it seems it's still unresolved. I'm wondering why that would happen and how to fix that.

I'm only using one machine so I guess it's not machine-related, not antivirus-related.

I'm noticing different memory management pattern during startup: the ClickOnce deployment takes more time and after a while it deallocates some memory. We are still talking about 12 MBytes in difference ( 67MB via ClickOnce, 50 via direct .exe).

This is driving me nuts...

Thanks

I guess it's not machine-related, not antivirus-related.

You need to prove that hypothesis by installing the same anti-virus your client has on a dev VM. If you cannot reproduce the slow start up compare ProcMon traces between the machines.


I believe Hans is on the money and the anti-virus is the most likely culprit, as per the correct answer in the QA you refer to in your question:

I have seen very poor performance (minutes vs a few seconds) for a newly deployed first run .Net application is the users are running antivirus software as the antivirus tool checks the newly Jitted assemblies are not malicious.


Make sure you're using .NET Framework 3.5 SP1 or above as "there are significant performance improvements in the area of startup. Particularly with WPF applications" and 3.5 SP1 includes Splash Screens.

A Splash Screen could be a quick (temporary) fix. Alas, not an ideal solution.


ClickOnce is getting pretty old now and there have been a lot of advancements in this field so why not adopt another strategy with a different deployment mechanism, such as Windows Installer and an Update Menu in the app. I detail the steps to make an MSI installer to Install to same path when upgrading application .

If you want to be strict about everyone being on the latest version instead of ClickOnce it would be better to have a web service the app pings on start up and downloads and executes the update when a new version is released.

Also, take tips from Google in this area. You remember the Jeff Atwood article: http://blog.codinghorror.com/the-infinite-version/

在此输入图像描述

If you dont use ClickOnce you can use things like NGEN AND bsdiff , possibly even Google courgette .


There's some other ways to speed up the startup of a ClickOnce application discussed here .


While this may not answer your question directly, hopefully it gives you food for thought on how to identify the root cause and/or use a different more up-do-date method for rolling out updates.

When you publish the build please choose the option of running the app in offline mode. Otherwise the clickonce installer will try to launch the app from your server rather than local exe.

Please let me know if there are any other scenarios need to look into or this helps.

Thanks,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM