Reputation:
I am getting the error as :
Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
while executing the code for integrating google calendar in my web site using google API v3:
the code is:
public bool connectCalendar()
{
ClientSecrets secrets = new ClientSecrets
{
ClientId = "10xxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxx82.apps.googleusercontent.com",
ClientSecret = "LxxxxxxxxxxxXYEb3Iaxo3C"
};
CalendarService calendarConnection; try
{
UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(secrets, new string[]{
CalendarService.Scope.Calendar}, "user",
CancellationToken.None, new FileDataStore("Books.ListMyLibrary")).Result;
//exception is thrown in this line
var initializer = new BaseClientService.Initializer();
initializer.HttpClientInitializer = credential;
initializer.ApplicationName = "secret-heaven-798";
calendarConnection = new CalendarService(initializer);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
return false;
}
return true;
}
am referring this link, why am getting this error? what am doing wrong?
i had add these line to the web config file:
<dependentAssembly>
<assemblyIdentity name="System.Core" PublicKeyToken="7cec85d7bea7798e" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
Upvotes: 0
Views: 212