Our C# client applications always take a much longer time to load on their first run. I haven't gone so far as to test if it is the first run of any .NET app that is slower, or if the first run of each .NET app is slower, but it remains a problem in any case. How can we eliminate this one-time startup hit?
My initial thoughts are that some sort of service could "warm up" the libraries. Would we need to do this for each of our apps, or just any .NET app? Would the user the service runs as make a difference? Perhaps rather than a Windows service, an application that runs on Windows login could do the dirty work? Again, would the fact that it's a .NET service be enough, or would we have to run each of our programs to eliminate the penalty? We could pass in a command-line parameter that would tell the program to exit immediately, but would that be sufficient, or would we need .NET to load each assembly we'll be using during the normal execution of the application?
Re: Some answers, we are deploying release-mode DLLs, and the slowdown is only on the first startup. We are delaying initialization of classes as much as possible.