1

I'm trying to develop a plugin using Google Plus api for NopCommerce project. I enabled Plus api on google console, and used the api using Nuget to my plugin.

PlusService plus = new PlusService(
                 new Google.Apis.Services.BaseClientService.Initializer()
                 {
                     ApiKey = "api_key_here"
                 });

            if (plus != null)
            {
                activitiesresource.listrequest list = plus.activities.list("user_id_here", new activitiesresource.listrequest.collectionenum());


                activityfeed feed = list.execute();
}

I'm getting the following error:

Could not load file or assembly 'System.Net.Http.Primitives, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f711d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

I tried the steps on this question: Could not load file or assembly System.Net.Http.Primitives. Located assembly's manifest definition does not match the assembly reference

I tried updating packages with selecting prerelease option of nuget and adding <dependentAssembly> to web.config of plugin, to web project, to machine.config, to app.config of plugin and all combinations. But still no luck.

Any help would be appreciated.

Community
  • 1
  • 1
Kuzgun
  • 4,649
  • 4
  • 34
  • 48

1 Answers1

2

Nop plugin web.configs aren't loaded, so no point in trying that.

Make sure you're referencing the same version of the assembly in both the plugin and your Nop project. Assemblies in your plugin folder won't be loaded if Nop already has one open by the same name.

The <dependentAssembly> entry not working would make sense if your plugin is referencing a newer version than Nop.

Cory Nelson
  • 29,236
  • 5
  • 72
  • 110
  • I installed HttpClients on Nop.Web and added dependentAssembly to web.config under Nop.Web. Now it works, thank you. – Kuzgun Aug 19 '14 at 15:36