I am working on a windows phone project that pulls data from gmail server using gmail api and downloads all the attachments with the specific format, everything works (server authentication, receiving data, ... ) well when I have all the code in the same project. I added a Windows Runtime component project to the solution and moved the code that handles server authentication and returns a GmailService to the runtime component project, so I could call it from a background agent scheduler project for push notifications as well as in the main project. I get this error every time I try to call the Server in the main project :
An exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.ni.dll but was not handled in user code
public static async Task<GmailService> Instantiate()
{
if (service == null)
await AuthenticateAsync();
return service;
}
private static async Task AuthenticateAsync()
{
// the code that creates the service if it doesn't exist
}
I added the reference to both scheduler and main project, and build are done successfully .