public async void Run(IBackgroundTaskInstance taskInstance) { _Deferral = taskInstance.GetDeferral(); //AppServiceTriggerDetails triggerDetails = taskInstance.TriggerDetails as AppServiceTriggerDetails; // _connection = triggerDetails.AppServiceConnection; //webserver = new MyWebserver(_connection); webserver = new MyWebserver(); await ThreadPool.RunAsync(workItem => { webserver.Start(); }); }
public async void Run(IBackgroundTaskInstance taskInstance) { _deferral = taskInstance.GetDeferral(); taskInstance.Canceled += OnTaskCanceled; /* * var triggerDetails = taskInstance.TriggerDetails as AppServiceTriggerDetails; * _connection = triggerDetails.AppServiceConnection; * _connection.RequestReceived += Connection_RequestReceived; */ //webserver = new MyWebserver(_connection); webserver = new MyWebserver(); await Windows.System.Threading.ThreadPool.RunAsync(workItem => { webserver.Start(); }); }