title: BackgroundTaskBuilder Register() issue
body: <p>I was developing application with Geofencing, when stuck at issue:</p>
  
  <p>ArgumentException (Value does not fall within the expected range)
  when I am trying to register background task for geofencing.</p>
  
  <p>Sample from MSDN has the same problem. I will show code from sample for clarity (link to sample: <a href="http://code.msdn.microsoft.com/windowsapps/Geolocation-2483de66#content" rel="nofollow">http://code.msdn.microsoft.com/windowsapps/Geolocation-2483de66#content</a>
  use scenario 5, 
  <a href="http://msdn.microsoft.com/en-us/library/windows/apps/dn440583.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/apps/dn440583.aspx</a> - instruction how to test).</p>
  
  <p>All what I have done:</p>
  
  <ol>
  <li>Build my app in Visual Studio.</li>
  <li>Deploy the app locally first and add the app to the lock screen in Settings. </li>
  <li>Close your app that is running locally.</li>
  <li>Launch your app in the Visual Studio simulator. </li>
  <li>Call RegisterBackgroundTask(..)  (simply pressed button register in scenario 5)</li>
  </ol>
  
  <p>There is code from MSDN sample that I have commented for successful app deploying in Simulator - tagged with ////// [my changes] ////////</p>
  
  <pre><code>    async private void RegisterBackgroundTask(object sender, RoutedEventArgs e)
      {
          try
          {
  
              // Get permission for a background task from the user. If the user has already answered once,
              // this does nothing and the user must manually update their preference via PC Settings.
              //BackgroundAccessStatus backgroundAccessStatus = await BackgroundExecutionManager.RequestAccessAsync();  ////// [my changes] ////////
  
              // Regardless of the answer, register the background task. If the user later adds this application
              // to the lock screen, the background task will be ready to run.
              // Create a new background task builder
              BackgroundTaskBuilder geofenceTaskBuilder = new BackgroundTaskBuilder();
  
              geofenceTaskBuilder.Name = SampleBackgroundTaskName;
              geofenceTaskBuilder.TaskEntryPoint = SampleBackgroundTaskEntryPoint;
  
              // Create a new location trigger
              var trigger = new LocationTrigger(LocationTriggerType.Geofence);
  
              // Associate the locationi trigger with the background task builder
              geofenceTaskBuilder.SetTrigger(trigger);
  
              // If it is important that there is user presence and/or
              // internet connection when OnCompleted is called
              // the following could be called before calling Register()
              // SystemCondition condition = new SystemCondition(SystemConditionType.UserPresent | SystemConditionType.InternetAvailable);
              // geofenceTaskBuilder.AddCondition(condition);
  
              // Register the background task
              geofenceTask = geofenceTaskBuilder.Register();
  
              // Associate an event handler with the new background task
              geofenceTask.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
  
              UpdateButtonStates(/*registered:*/ true);
  
              ////// [my changes] ////////
              //switch (backgroundAccessStatus)
              //{
              //    case BackgroundAccessStatus.Unspecified:
              //    case BackgroundAccessStatus.Denied:
              //        rootPage.NotifyUser("This application must be added to the lock screen before the background task will run.", NotifyType.ErrorMessage);
              //        break;
  
              //    default:
              //        // Ensure we have presented the location consent prompt (by asynchronously getting the current
              //        // position). This must be done here because the background task cannot display UI.
              //        GetGeopositionAsync();
              //        break;
              //}
              ////// [my changes] ////////
          }
          catch (Exception ex)
          {
              // HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED) == 0x80070032
              const int RequestNotSupportedHResult = unchecked((int)0x80070032);
  
              if (ex.HResult == RequestNotSupportedHResult)
              {
                  rootPage.NotifyUser("Location Simulator not supported.  Could not get permission to add application to the lock screen, this application must be added to the lock screen before the background task will run.", NotifyType.StatusMessage);
              }
              else
              {
                  rootPage.NotifyUser(ex.ToString(), NotifyType.ErrorMessage);
              }
  
              UpdateButtonStates(/*registered:*/ false);
          }
      }
  </code></pre>
  
  <p>Exception falls on string:
  <code>geofenceTask = geofenceTaskBuilder.Register();</code></p>
  
  <p>Can anybody help me?</p>
  
  <p>P.S. Same question thread on msdn - <a href="http://social.msdn.microsoft.com/Forums/en-US/3d69f2f9-93e0-401b-8a13-598dc671fa4f/backgroundtask-register?forum=winappswithcsharp" rel="nofollow">http://social.msdn.microsoft.com/Forums/en-US/3d69f2f9-93e0-401b-8a13-598dc671fa4f/backgroundtask-register?forum=winappswithcsharp</a> </p>