Windows Metro Style app 發生 Google Data API Library 錯誤

本文关键字:Data API Library 錯誤 Google 發生 Metro Style app Windows | 更新日期: 2023-09-27 18:33:46

OS: Windows 8 Consumer Preview
IDE:Visual Studio 11 Beta

我创建了一个空白应用程序(Windows Metro 样式)。
并添加谷歌文档API示例代码。(如下)
它发生编译错误。(在模块 System.dll 中找不到 System.ComponentModel.ExpandableObjectConverter 类型

但是当我创建一个控制台应用程序(Windows)时,不会发生编译错误和谷歌文档API工作良好。

有什么想法吗?

using System;
using Google.GData.Client;
using Google.GData.Documents;
namespace MyDocumentsListIntegration
{
  class Program
  {
    static void Main(string[] args)
    {
      DocumentsService service = new DocumentsService("MyDocumentsListIntegration-v1");
      // TODO: Authorize the service object for a specific user (see Authorizing requests)
      // Instantiate a DocumentsListQuery object to retrieve documents.
      DocumentsListQuery query = new DocumentsListQuery();
      // Make a request to the API and get all documents.
      DocumentsFeed feed = service.Query(query);
      // Iterate through all of the documents returned
      foreach (DocumentEntry entry in feed.Entries)
      {
        // Print the title of this document to the screen
        Console.WriteLine(entry.Title.Text);
      }
    }
  }
}

Windows Metro Style app 發生 Google Data API Library 錯誤

ExpandableObjectConverter 类似乎存在于标准 .NET 框架中,但如果您查看 System.ComponentModel 命名空间的 Metro API 文档,该类未列出,因此不可用。

我建议使用适用于 Metro 风格的 .NET 页面来发现编写 Metro 风格应用程序时可用的内容。