Ivan Crojach Karačić
Ivan Crojach Karačić

Reputation: 1911

Portable class library for Google Drive Api namespace referencing

I am developing a Windows Phone application which needs to read google docs spreadsheets and came to a problem on the first stemp. According to the accepted answer on this and this topics I have created something like this in the Portable class library

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)
    {

    }
}

When trying to build it I get this error:

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

This is a Windows Phone 7.1 app and the PCL is setup to .Net 4+, Silverlight 4+ windows phone 7.5+

Any ideas?

Upvotes: 1

Views: 399

Answers (1)

Alaa Masoud
Alaa Masoud

Reputation: 7135

PCL projects cannot use platform specific-libraries, they can only use other PCL libraries which also must support compatible platforms. While referencing may work as in your case but you can't actually use them.

Read this for more info.

However, since the Google Data API is an open source project you could make a PCL and take the functionality you need from their API and add it to your PCL and use that instead.

Upvotes: 1

Related Questions