c# - Problems with WCF endpoints hosted from Windows Service -
i have managed windows service hosts couple of wcf endpoints. service set start automatically when pc restarted. on reboot find line of code:
servicehost wcfhost1 = new servicehost(typeof(wcfhost1));
in onstart() method of service takes somewhere between 15 - 20 seconds execute. have 2 such statements second 1 executes in flash. first 1 takes long. know causing bottleneck? because of this, call exceeds 30 seconds , result scm thinks service timed out while trying initialize itself. now, know easy me spin off thread , return onstart() right away i'd know cause delay.
this happens only when service starts on pc reboot. if pc , running, service starts & stops in less second.
this might provide more help. basically, think need figure out dependencies have , add them service, start before yours.
this shot in dark, .net framework hasn't loaded yet. perhaps, can try set automatic start delayed automatic start, allow .net framework , other windows services time start.
also, when .net application starts up, compiled just-in-time compiler. waiting .net compile it.
lastly, depending on type of wcf instance using, have issue constructor taking awhile initialize.
hope helps.
Comments
Post a Comment