Building calendar v3 app with c#, .net 4.5, and MS Studio Express 2012 - getting 'Could not load ... System.Net.Http.Primatives, Version=1.5.0.0

456 views
Skip to first unread message

Jim O'Brien

unread,
Sep 7, 2013, 5:56:21 PM9/7/13
to google-ca...@googlegroups.com
I am building a Google Calendar V3 class library in C# .Net 4.5 using MS Studio Express 2012 on a fully-updated Win 7 Pro.

I created the project and made an exact copy of the code I used in a Console app to do the same authorization.

The only difference in the setup of the apps is that the original is the sum of 3 days work setting up references that actually work.

For the new app I followed the directions in a Google Wiki (Build Wiki)  that told me to use NuGet and install Google_Apis_Calendar_v3 and then Google_Apis_Authentication.

Once installed, the app compiled just fine with no errors or warnings.

However, when I run the app, I get the following error:

Could not load file or assembly 'System.Net.Http.Primitives, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
   at Google.Apis.Http.HttpClientFactory.CreateHandler(CreateHttpClientArgs args)
   at Google.Apis.Http.HttpClientFactory.CreateHttpClient(CreateHttpClientArgs args) in c:\code.google.com\google-api-dotnet-client\default_3\Tools\Google.Apis.Release\bin\Debug\output\default\Src\GoogleApis\Apis\Http\HttpClientFactory.cs:line 36
   at Google.Apis.Services.BaseClientService.CreateHttpClient(Initializer initializer) in c:\code.google.com\google-api-dotnet-client\default_3\Tools\Google.Apis.Release\bin\Debug\output\default\Src\GoogleApis\Apis\Services\BaseClientService.cs:line 217
   at Google.Apis.Services.BaseClientService..ctor(Initializer initializer) in c:\code.google.com\google-api-dotnet-client\default_3\Tools\Google.Apis.Release\bin\Debug\output\default\Src\GoogleApis\Apis\Services\BaseClientService.cs:line 181
   at Google.Apis.Calendar.v3.CalendarService..ctor(Initializer initializer) in c:\code\google.com\google-api-dotnet-client\default\Tools\Google.Apis.NuGet.Publisher\Template\Build\Google.Apis.Calendar.v3.cs:line 939
   at CalProc.Initialize()

When I look at the System.Net.Http.Primitives in the references it shows me:

..... \Microsoft.Net.Http.2.1.10\lib\net45\System.Net.Http.Primitives.dll


 Google should be embarrassed by the lack of quality and support of the Google Calendar V3 API "package" especially when thye publish a Wiki in August of this year that ultimately doesn't work.

Unfortunately I don't remember what I did during the 3 days on the first app, I just tried things until the app worked.

Does anyone know how to fix this?

Regards,
Jim

Message has been deleted

Andrew Pepper

unread,
Nov 21, 2014, 12:56:03 PM11/21/14
to google-ca...@googlegroups.com
Hi Jim, I'm getting (I think) exactly the same problem - did you solve the problem?
-Andrew

Steve M

unread,
Dec 8, 2014, 4:59:39 PM12/8/14
to google-ca...@googlegroups.com
hi, i'm getting the same exception too, any solution for that problem?

Trino Puertas Fabrega

unread,
Dec 10, 2014, 3:36:49 AM12/10/14
to google-ca...@googlegroups.com
I have the same problem, i fix this with the following steps.

-> Uninstall the class libraries.
-> Change the framework 4.5 Client Profile to 4.5
-> Install The class libraries.
-> Distribute the app.exe and the app.exe.config
-> I read that change the versions of the referenced libraries works.

Introducir código aquí...

Steve M

unread,
Dec 11, 2014, 4:47:55 PM12/11/14
to google-ca...@googlegroups.com
hi, thanks for ur answer, but my framework version is allready 4.5 (w/o client profile)

--
You received this message because you are subscribed to a topic in the Google Groups "Google Calendar API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-calendar-api/cd1kgIZ3H6M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-calendar...@googlegroups.com.
To post to this group, send email to google-ca...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-calendar-api.
For more options, visit https://groups.google.com/d/optout.

Mario Granata

unread,
Jun 23, 2015, 4:31:13 PM6/23/15
to google-ca...@googlegroups.com
I have the same problem, 
I fix this copying the file app.exe.config in same folder with app.exe
Now it works

Regards,
Mario

Reply all
Reply to author
Forward
0 new messages