2014-10-20 4 views
0

https://code.msdn.microsoft.com/Office-365-APIs-Windows-8-63a74ba2에 제공된 클라이언트 라이브러리를 사용하여 Windows 8 앱 샘플을 실행하려고하는데 다음 오류가 발생합니다.Office 365 API : 클라이언트 라이브러리를 사용하는 Windows 8 앱

"값은 null 일 수 없습니다 매개 변수 이름 :. ServiceContext는"작업 EnsureClientCreated() {

 var authenticator = new Authenticator(); 
     var result = await authenticator.AuthenticateAsync("MyFiles", ServiceIdentifierKind.Capability); 

     // Create a client proxy: 
     this.client = new SharePointClient(result.ServiceUri, result.GetAccessToken); 
     this.client.Context.IgnoreMissingProperties = true; 
    } 

    /// <summary> 
    /// Populates the page with content passed during navigation. Any saved state is also 
    /// provided when recreating a page from a prior session. 
    /// </summary> 
    /// <param name="sender"> 
    /// The source of the event; typically <see cref="NavigationHelper"/> 
    /// </param> 
    /// <param name="e">Event data that provides both the navigation parameter passed to 
    /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and 
    /// a dictionary of state preserved by this page during an earlier 
    /// session. The state will be null the first time a page is visited.</param> 
    private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e) 
    { 
     Exception exception = null; 

     try 
     { 
      this.DefaultViewModel["Items"] = new[] { new { Primary = "Loading...", Secondary = "Please wait..." } }; 

      IOrderedEnumerable<IFileSystemItem> files = await GetOneDriveFiles(); 

      if (files == null) 
      { 
       this.DefaultViewModel["Items"] = null; 
      } 
      else 
      { 
       this.DefaultViewModel["Items"] = files.Select(file => new 
       { 
        Primary = file.Name, 
        Secondary = "Last modified on " + ToLocalTimeString(file.TimeLastModified) 
       }); 
      } 
     } 
     catch (Exception ex) 
     { 
      exception = ex; 
     } 

     if (exception != null) 
     { 
      await ShowErrorMessageAsync(exception.Message); 
     } 
    } 

    private async Task<IOrderedEnumerable<IFileSystemItem>> GetOneDriveFiles() 
    { 
     await EnsureClientCreated(); 

     // Obtain data: 
     var filesRequest = await this.client.Files["Shared with Everyone"].ToFolder().Children.ExecuteAsync(); 
     var files = filesRequest.CurrentPage.OrderBy(e => e.Name); 
     return files; 
    } 

아이디어 비동기 개인

?

답변

0

여기서 볼 수있는 현재 툴링 버전을 사용해보십시오 : http://aka.ms/office365apitoolspreview 그래도 문제가 해결되지 않으면 문제를 일으키는 특정 API 호출의 HTTP 추적을 보는 것이 도움이됩니다.

+0

나는 귀하의 링크를 따라 온라인으로 셰어 포인트에 연결되었습니다. 여전히 오류가 발생합니다. – Thilo