1

After starting my WPF application, the very first call I make to a remote SOAP service (client generated using WCF) results in a tiny pause.

In the debugging output during the pause, I see about 5 or 6 libraries from the GAC load up:

System.ServiceModel
System.Runtime.Serialization
SMDiagnostics
System.ServiceModel.Internals
Microsoft.VisualStudio.Diagnostics.ServiceModelSink
System.IdentityModel
System.IdentityModel.Selectors

I've found that I can just make a fake call with the client at startup (e.g. https://fake-host-for-preloading-purposes), which will trigger these libraries to load at startup and remove that pause. However, that also means I'm forcing a DNS lookup on a fake host and intentionally resulting in an exception that I have to ignore.

I tried to follow the suggestions here: Preload all assemblies (JIT) ...but none of them made any difference.

Is there a cleaner way (besides the fake call) to spin up these libraries at startup?

jhilgeman
  • 1,543
  • 10
  • 27

0 Answers0