Working on .NET gives me good performance in general for the application itself but the initial load times for my application are quite large. A lot of it goes towards loading assemblies which is difficult to gauge.
Are there any optimizations that I can apply to my assemblies to make them faster to load without involving the GAC or Ngen and those are not available for ClickOnce?
This is a WinForms 2.0 project. I can upgrade it to a 3.5 but that limit my user base. I have .NET Framework 3.5 installed on my machine.
I have created a very small .exe that shows a splash screen asap. After that I initialize everything.
The JIT-compiler loads modules that are called from the method that is being jitted. So you have to take care that the method that shows the splash screen, does not call methods in modules that you do not want loaded yet.
Example:
The [MethodImpl(MethodImplOptions.NoInlining)] is needed so the ContinueStartup() method does not get inlined by the jit, because that will cause the modules to be loaded too early.