は私が運転した後に解雇ますコールバックで拡張実行を要求UWPアプリケーションを持って要求して以下のように起動します:UWP ExtendedExecutionエラー拡張実行
private async void HandleOnSyncStart(ISyncStart msg)
{
// request extended execution
ExtendedExecutionResult result = await
Utils.ExtendedExecutionHelper.RequestExtendedExecutionSessionAsync();
}
が、私はエラーに
The group or resource is not in the correct state to perform the
requested operation. (Exception from HRESULT: 0x8007139F)
を以下の取得します
RequestExtendedExecutionSessionAsync()メソッドの返信時にエラーがスローされます。これは、スタックトレースです:
at Windows.ApplicationModel.ExtendedExecution.ExtendedExecutionSession..ctor()
at MyProject.UWP.Utils.ExtendedExecutionHelper.<RequestExtendedExecutionSessionAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at MyProject.UWP.MainPage.<HandleOnSyncStart>d__65.MoveNext()
拡張実行セッションが(RequestExtendedExecutionAsyncに要求されている)以下のようなExtendedExecutionHelper静的クラスのメソッド:
public static async Task<ExtendedExecutionResult> RequestExtendedExecutionSessionAsync()
{
ClearExtendedExecutionSession(); //first clear if any session granted
var newSession = new ExtendedExecutionSession();
newSession.Reason = ExtendedExecutionReason.Unspecified;
newSession.Description = "Extended Execution Request";
newSession.Revoked += OnExtendedExecutionSessionRevoked;
ExtendedExecutionResult result = await newSession.RequestExtensionAsync();
switch (result)
{
case ExtendedExecutionResult.Allowed:
Debug.WriteLine(string.Format("ExtendedExecutionHelper: ExtendedExecution allowed."));
session = newSession;
break;
case ExtendedExecutionResult.Denied:
Debug.WriteLine(string.Format("ExtendedExecutionHelper: ExtendedExecution denied."));
newSession.Dispose();
break;
}
return result; //ERROR
}
私はそのページのエラーを認識しており、修正しました。しかし、セッションをインスタンス化するときにエラーが発生しないように、エラーのコード行を見てください。私はEES ctorコールからエラーを取得していないので、複数のEESで何かをしなければならないとは思わない。ありがとう – pixel
実際、あなたは正しいです、私はEES c-torを次々と2回呼び出すことを試みました、そして、それは私が得たものです。ありがとう、 – pixel