I fail when trying to use the Google API v3 in a user control.
Steps:
- Create a new project in Visual Studio Express 2013 Update 4. Target framework: .NET 4.5 (tried 4.0 too)
- Install NuGet package "Google.Apis.Calendar.v3 Client Library" and all and all dependencies
- Add new User Control "MyControl"
- In MyCalendar_Load add the following line: CalendarService service = new ServiceCalendar();
- Add using Google.Apis.Calendar.v3;
So the code of my control looks like:
using System;
using System.Windows.Forms;
using Google.Apis.Calendar.v3;
namespace Google_Calendar_Test
{
public partial class MyCalendar : UserControl
{
public MyCalendar()
{
InitializeComponent();
}
private void MyCalendar_Load(object sender, EventArgs e)
{
CalendarService service = new CalendarService();
}
}
}
Then I compile my solution so I get my newly created MyControl. When I try to put the control on the form the following error message appears:
System.IO.FileNotFoundException / Could not load file or assembly Google.Apis,
In the form I can add the CalendarService and start it without any problems. I'm puzzled.
Update
The version in the error message (V 1.0.0.23042) doesn't match to the version NuGet installed (V 1.0.0.26011). But this doesn't make any sense to me.