Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ways to speed up the startup of a ClickOnce application

Tags:

c#

clickonce

I have a Visual Studio 2005/C# ClickOnce application that gets all its data from a Web service. I've gotten the application tuned where it feels pretty snappy to the users, even though it has to go and fetch data from the Web service for almost everything.

However, the startup is still pretty sluggish. It seems like it takes a while to generate the first web service call. After that, it's fine.

What can I do to speed up the startup of this type of an application? Do I need to generate a serialization assembly?

like image 339
AngryHacker Avatar asked Feb 28 '23 16:02

AngryHacker


2 Answers

Spend some time analyzing the assemblies loaded by your application. That's going to have the greatest effect on the load time of your application. If you have types that are only used on occasion, move them to another assembly. ClickOnce can optimize the download of assemblies on demand so reducing the required number of assemblies at load time will make it load faster.

You can also have a sort of "stub" launcher with bare minimum assembly dependencies that loads the other assemblies dynamically (Assembly.Load) and invokes the real processing after they are loaded.

like image 141
Paul Alexander Avatar answered Mar 08 '23 05:03

Paul Alexander


You can use ClickOnce file groups to split your application into manageable pieces and then use the ClickOnce API to download groups when needed. The article ClickOnce File Groups explains how to do this.

like image 28
Peter Lillevold Avatar answered Mar 08 '23 04:03

Peter Lillevold