I have the following line of code that is supposed to call a method to run synchronously(set it and forget it):
public class NotificationClass
{
public void updateSomething
{
Task.Run(() => { base.Channel.SomeMethod(someData); });
}
}
//WCF Service
public class MyWCFService
{
public void SomeMethod(Data someData)
{
HubClass.SomeMethod(someData);
}
}
This works just fine when I debug on my local machine but SomeMethod() is never called when the app is deployed to a production server. The production server is an Azure Windows Server 2012 machine running IIS 8.
Does something need to be configured in IIS to get async tasks to work properly? There are no errors being reported in event viewer.
SomeMethod
inside a task. That will allow you to see exactly what's going on and if your results are expected.Channel
getting disposed?