Reputation: 11697
I am in process of creating an application for Winforms. I have plans to ship this application for Windows Phone later. So I decided to use Portable libraries. I have following Target frameworks for my portable libraries:
.NET Framework 4 and higher
Silverlight 4 and higher
Windows Phone 7 and higher
.NET for Windows Store apps
In my portable libraries, I have referenced following libraries from Google drive SDK:
DotNetOpenAuth.dll
Google.Apis.Authentication.OAuth2.dll
Google.Apis.dll
Google.Apis.Drive.V2.dll
Google.Apis.OAuth2.V2.dll
log4net.dll
Newtonsoft.Json.Net35.dll
Till now when I build my solution, it works fine as I have these references anywhere. But when I use these references in my code like:
using Google.Apis.Authentication;
using File = Google.Apis.Drive.v2.Data.File;
public interface IUtilities
{
void SampleMethod(IAuthenticator authenticator, File file);
}
Now, I get NO compilation error. However when I try building the solution I get following
Error 1 The type or namespace name 'IAuthenticator' could not be found (are you missing a using directive or an assembly reference?)
Error 3 The type or namespace name 'Google' could not be found (are you missing a using directive or an assembly reference?)
If I write more code using these libraries, I get error for all those objects in similar way. Can anyone help me to understand this? Let me know if you need any more info. Thanks.
Upvotes: 1
Views: 648
Reputation: 16744
Any libraries you reference from a Portable Class Library must also be portable (and support compatible platforms). Json.NET has a portable version, but the other libraries you are using probably don't. You could get the source code to those libraries and port them to PCLs, or you can create portable abstractions for the functionality they provide and use those abstractions to allow you to call into platform-specific code.
Here are some sources of more information about using Portable Class Libraries:
Upvotes: 3