title: Request lockscreen access throws exception hangs or throws exception in mscorlib.dll
body: <p>I use the following method to request lockscreen access in WinRT:</p>
  
  <pre><code>public async void RequestLockScreenAccess()
      {
          var status = BackgroundExecutionManager.GetAccessStatus();
          if (status == BackgroundAccessStatus.Unspecified || status == BackgroundAccessStatus.Denied)
              status = await BackgroundExecutionManager.RequestAccessAsync();
          switch (status)
          {
              case BackgroundAccessStatus.AllowedWithAlwaysOnRealTimeConnectivity:
                  _mainInfo.NotifyUser = "This app is on the lock screen and has access to Always-On Real Time Connectivity.";
                  break;
              case BackgroundAccessStatus.AllowedMayUseActiveRealTimeConnectivity:
                  _mainInfo.NotifyUser = "This app is on the lock screen and has access to Active Real Time Connectivity.";
                  break;
              case BackgroundAccessStatus.Denied:
                  _mainInfo.NotifyUser = "This app is not on the lock screen.";
                  break;
              case BackgroundAccessStatus.Unspecified:
                  _mainInfo.NotifyUser = "The user has not yet taken any action. This is the default setting and the app is not on the lock screen.";
                  break;
          }
      }
  </code></pre>
  
  <p>This can give me 2 different errors. If i place a breakpoint before or on line</p>
  
  <pre><code>status = await BackgroundExecutionManager.RequestAccessAsync();
  </code></pre>
  
  <p>the code will execute, but throw the following exception: </p>
  
  <blockquote>
    <p>An unhandled exception of type 'System.Exception' occurred in mscorlib.dll
    Additional information: Element not found. (Exception from HRESULT: 0x8002802B (TYPE_E_ELEMENTNOTFOUND))</p>
  </blockquote>
  
  <p>As i read in another post, this is a bug known to others, don't know about Microsoft. If i don't place a breakpoint before this line, execution will instead hang. What am i doing wrong here?</p>
  
  <p>It seems that if i uninstall my application, it might work, but then after some reruns it will eventually fail again.</p>