The problem even is that I set the threads as "thrd.IsBackground = false". iis does not think that it works, although these are lengthy processes. If I do not turn off the standby mode for the application pool, it will shut down because it thinks it is idle. In addition, if I use the new version, it interrupts all threads that are started, instead of waiting for the true downtime of all processes before reusing and using the new code. What am I doing wrong here? this is my webservice code:
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
public class LetterInitiateWS : System.Web.Services.WebService
{
private static Processor processor = new Processor();
[WebMethod]
public void ExecuteBulkRun()
{
var thrd = new Thread(() => ThreadExecuteBulkRun());
thrd.IsBackground = false;
thrd.Start();
}
[WebMethod]
public void ExecuteTemplateBulkRun(string templateCategory, string TemplateType)
{
var thrd = new Thread(() => ThreadExecuteTemplateBulkRun(templateCategory, TemplateType));
thrd.IsBackground = false;
thrd.Start();
}
private void ThreadExecuteBulkRun()
{
processor.ExecuteBulkRun();
}
private void ThreadExecuteTemplateBulkRun(string templateCategory, string TemplateType)
{
processor.ExecuteTemplateBulkRun(templateCategory, TemplateType);
}
}
}
source
share