0

I developed XML Web service with C#/.Net, But the problem is first request for the web method is really slow.

How can I sort the issue?. I have applied several solutions from the internet findings, but not successful.

Thanks in advance.

5
  • Please share the solutions and their links from the internet that you already applied. I hate having you re-try stuff you've already done.
    – rene
    Commented May 12 at 6:43
  • 3
    Your problem is that .asmx files are compiled on first reference after the web app is started. You need either to identify a way to precompile or do a request after start up to get them compiled. Also I'm removing asp.net-core as .asmx is part of the WebForms stack and not part of modern .NET.
    – Richard
    Commented May 12 at 7:39
  • I would suggest that you disable the app pool timeout. If no one is using the system, then the app pools will timeout and go to sleep. The restart thus takes time. The setting is under IIS applicaiton pools, and the so called process model timeout. You want to disable this feature. This issue has ZERO to do with recompiling. As I assume that if this was a ONE TIME issue, then it would only occur once after a re-deployment, and the issue looks to be not the VERY first time such a web method end point is used, but the first time even if the site been running for weeks. Commented May 12 at 22:46
  • asmx files are not necessary compiled on first use, and the publishing wizard has had the option to publish as pre-compiled for more then 15 years now. So, sure, try checking the precompile box before a deploy, but I highly doubt this delay issue has anything to do with compiling unless this occurs only EVER one time after a deployment, not that the site been idle say for a few hours. So, SUPER important that you the poster here make this issue clear: is delay only ever one time, or does it occur again after some time of not using the site? So deploy as pre-compiled and see if issue goes away Commented May 12 at 22:56
  • Try enabling precompiled XmlSerializer assemblies with <GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>. See When to change the Generate Serialization Assembly value?. XmlSerializer - the first deserialization is very slow and What is MyAssembly.XmlSerializers.dll generated for?.
    – dbc
    Commented May 13 at 21:43

0

Browse other questions tagged or ask your own question.