2013-05-19 38 views
1

我正在開發一個Windows Phone應用程序,它需要讀取Google文檔電子表格並在第一個stemp中遇到問題。據對thisthis話題我已經創建了這樣的事情在便攜式類庫接受的答案Google Drive Api命名空間引用的便攜式類庫

using Google.GData.Spreadsheets; 

public void Read() 
{ 
    SpreadsheetsService myService = new SpreadsheetsService("service"); 
    myService.setUserCredentials("[email protected]", "password"); 

    SpreadsheetQuery query = new SpreadsheetQuery(); 
    SpreadsheetFeed feed = myService.Query(query); 

    foreach (SpreadsheetEntry entry in feed.Entries) 
    { 

    } 
} 

當試圖建立它,我得到這個錯誤:

The type or namespace name 'Google' could not be found 
(are you missing a using directive or an assembly reference?) 

這是一款Windows Phone 7.1應用程序和PCL設置爲.Net 4+,Silverlight 4+ windows phone 7.5+

任何想法?

回答

1

PCL項目不能使用特定於平臺的庫,它們只能使用其他必須支持兼容平臺的PCL庫。儘管引用可能與您的情況一樣,但您無法真正使用它們。

閱讀this瞭解更多信息。

但是,由於Google Data API是一個開源項目,因此您可以創建PCL並從其API中獲取所需的功能,並將其添加到PCL中,然後使用它。