Newtonsoft.json assembly package version mismatch - c#

I am trying to use SocketIO4Net to create socket.io client in .net. Itseems SocketIO4Net has a dependency of Newtonsoft.Json >= 4.0.8. I also am using PushSharp library which has a Newtonsoft.Json dependency of >= 4.5.10. I got NewtonSoft.Json 4.5.11 when i first installed PushSharp and I thought this version should support SocketIO4Net as well since its a higher version but i get this error whenever am trying to connect to socket.io server.
Could not load file or assembly 'Newtonsoft.Json, Version=4.0.8.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I have been banging my head all day with these dependency issues, I would be very grateful if someone can point me in the right direction.

Found solution, try with:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30AD4FE6B2A6AEED" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

You can modify assembly-binding configuration and add a redirect. See Redirecting Assembly Versions on MSDN.
Basically you want to add following snippet to your app.config or web.config file:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json"
publicKeyToken="30ad4fe6b2a6aeed"
culture="neutral" />
<!--
Assembly versions can be redirected in application,
publisher policy, or machine configuration files.
-->
<bindingRedirect oldVersion="1.0.0.0-4.5.11.0" newVersion="4.5.11.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
EDIT
Why do you need to redirect assembly versions? Even though SocketIO4Net supports newer versions of Newtonsoft.Json, it was compiled against a single version (4.0.8 in your case). This version is stored in the DLL and it is used to load DLLs SocketIO4Net depends on.
Note that NuGet dependencies are not the same as DLL/runtime dependencies - NuGet dependency on Newtonsoft.Json >= 4.0.8 only means that you will be allowed to install SocektIO4Net into a project that has a newer version of Newtonsoft.Json, it has nothing to do with runtime settings.
That being said, recent NuGet versions should add assembly-binding-redirects automatically for you if your project has app.config or web.config file.

The above solutions are correct but there is one more point that should not be forgotten: the app.config content was the same as the above solutions.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
But it's a good idea to check if it's up to date. In my case, Newtonsoft.JSON (v.6.0.4) has come to depend on another package.
There are two option;
Update (Newtonsoft.JSON package) last versions.
Update app.config file in the version numbers.
And last advice, if you are working with more than one project, eg.
exe-dll and check both versions if there is Newtonsoft.JSON.

Put in an assembly redirect in your app/web.config;
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" PublicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="1.0.0.0-4.5.11.0" newVersion="4.5.11.0" />
</dependentAssembly>
Please note the versions numbers need to match the version you have installed.

Had this same issue.
Just resolved it.
It happened after NuGet was used to install Ext.NET which has a dependency for Newtonsoft.JSON.
There was already a Newtonsoft.JSON.dll file in /bin (and obviously a reference to it in the web.config file) folder without checking I started the NuGet Package-Install procedure while debugging(so the file probably had a lock).
On the runtime error window it will tell you on the stack trace what part of the manifest it has a problem with, mine was major version so I checked the install package version. and it was 1 major version out. Found the original NuGet file under: "[physical path]/../packages/Newtonsoft.Json.[version]/lib/[.net version]/"
Both Manifest and Library was there so copied it into /bin folder, updated the root web.config assembly information and it worked.
Code samples:
Before
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
After
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
Hope this helps

In my case, I removed the package with NuGet and installed a fresh one. Then, remove the reference from References and add again manually. Works like charm. Hope resolve for you.

I was working on an old project recently. I needed to update our Newtonsoft.Json.dll, since I had to utilize a "new" API which required a newer version, but I still had other DLLs that required the old version.
bindingRedirect you say? Nope. It kept complaining about the manifest mismatch.
Separate codeBase tags? Nope. It kept complaining about the manifest mismatch.
The problem was, apparently, that the old version of Newtonsoft.Json.dll (3.0.0.0) does NOT have a PublicKeyToken, but the "new" version (4.5.7.1) DOES have a PublicKeyToken. Therefore they couldn't share the same dependentAssembly-tag.
This is what I ended up with:
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="" culture="neutral"/>
<codeBase version="3.0.0.0" href="bin\Newtonsoft_Old\Newtonsoft.Json.dll" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<codeBase version="4.5.0.0" href="bin\Newtonsoft.Json.dll" />
</dependentAssembly>

Got the above Error: in Visual Studio 2013
To Fix: In package mamnager Execute: Install-package newtonsoft.json
This will add a new line in packages.config
<package id="Newtonsoft.Json" version="6.0.5" targetFramework="net45" />
Remove the previous line which might point to previous version on packages.config.
Delete the old version's directory on the packagers directory.
Remove the reference of NewtonSoft.Json and readd it pointing to the latest version.
Root webconfig will have the following
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
once everything is done. Close and reopen visual studio.
This should fix it.
I had the same error when installing
PM> install-package durandal.starterkit
I used the above method to fix.

I have fixed this issue easily: I had not copied the xml configuration file from the compilation folder.
I just made sure that the xml configuration file was also included along with my program and everything worked fine!

Just had this happen with TeamCity and I imagine others will soon experience this. This probably applies to most build servers that pull NuGet packages.
All the answers that say to do redirects are correct. However, you need to still define the correct version number. My project was using Newtonsoft.Json 7.0, however, they had just released 8.0 and TeamCity was pulling down 8.0 which was causing issues only on the server and not locally. All my redirects were set to 7.0.
Make sure that the deployed application is actually getting the correct version from NuGet and not just the latest and greatest. Or update your config to point to the newest version.

Other solutions didn't work for me. Although I had different nuget package (Newtonsoft.Json.Schema version=3.0.0.0).
So my project was an ASP .NET project and the Newtonsoft.Json.Schama package was referred in a .NET Standard project. The solution was simply to add the Nuget package to the WEB (or startup) project too, and the problem disappeared.

Related

Could not load file or assembly 'System.Buffers, Version=4.0.2.0...'

I'm getting the following exception when trying to call GetDatabase method of the MongoClient class after adding a new configuration using VS config. manager:
Could not load file or assembly 'System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I installed the latest System.Buffer nuget package v4.5.1, created dependentAssembly in my app.config and Reference in my .csproj file, but I still have the same issue. For some reason it tries to reference System.Buffer with v4.0.2. Has anyone had a similar error and how did you solve it?
Could not load file or assembly 'System.Buffers, Version=4.0.2.0…'
Solution
1) use CMD(run as Administrator ) and type
cd xxxx(xxxx\packages\System.Buffers.4.5.1\lib\netstandard2.0))
run
gacutil /i System.Buffers.dll
Then, when you finish it, please run update-package -reinstall under package manager console to reinstall the package.
2) you can try to change Version=4.0.2.0 to Version=4.0.3.0 in csproj file.
Besides, there is a similar issue you can refer to.
The easiest way is to use Nuget package manager, downgrade system.buffers to any lower version, and then upgrade it to the latest again.
In my case, I had to add the assembly reference in the web.config that was already published in the Azure App Service, inside the <configuration></configuration> tag:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
I ran into this issue when adding the Azure.Storage.Blobs package to a Class Library where I was attempting to create a blob uploader client. When I added the package, it created an app.config with the correct binding redirect:
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
The issue, however, is that this binding redirect needs to live in the app.config of the application, not the class library: Can a class library have an App.config file?
So, adding the binding redirect is the correct way to solve this issue. Just make sure the binding redirect is specified in the calling web/console/etc app.
Another solution: just remove references to the assembly in the Web.config files of the projects generating the exception.
The references can look like:
<dependentAssembly>
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
</dependentAssembly>
I ran into a similar issue, tried all the steps above. In the end, another project had an older version of the same library. Too many projects in the solution, the other reference was scrolled out of view.

Could not load file or assembly 'Microsoft.SqlServer.Types, Version=10.0.0.0' or one of its dependencies

Recently I have started using SSMS 2017 (v17.5). In my MVC application, I am getting Could not load file or assembly 'Microsoft.SqlServer.Types, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. error. Only thing changed in my application is Microsoft.SqlServer.Types version which is 14.0.0.0 now. Previously, it was 12.0.0.0.
Following are different options I have tried so far based on my research (this includes another stackoverflow articles + google) but I am getting same error.
Add <dependentAssembly> in app.config
<dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="10.0.0.0-11.0.0.0" newVersion="14.0.0.0" />
</dependentAssembly>
Adding following line in Global.asax.cs in Application_Start method.
SqlProviderServices.SqlServerTypesAssemblyName = "Microsoft.SqlServer.Types, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91";
Installing Microsoft.SqlServer.Types using NuGet.
PM> Install-Package Microsoft.SqlServer.Types
Searched for 10.0.0.0 referance in entire project but didn't find any referance.
I do have Microsoft System CLR Types for SQL Server installed for 2012, 2014, 2016 and 2017.
What am I missing here?
After spending almost a day, I was able to fix this issue. From my question above, option-1 worked for me. Only tweak was to add that in web.config instead of app.config. Hope this help someone else.
Code: web.config
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Microsoft.SqlServer.Types -Version 14.0.314.76 is the current version. try changing your version number. Second, check your .csproj file, Application also maintains its dependencies in .csproj file
For a net library project that have the same error, I go to NuGet packages and install this library:
Microsoft.SqlServer.Types
and its works.

different third party dll's have minimum requirement of different versions of same dll [duplicate]

I am trying to use SocketIO4Net to create socket.io client in .net. Itseems SocketIO4Net has a dependency of Newtonsoft.Json >= 4.0.8. I also am using PushSharp library which has a Newtonsoft.Json dependency of >= 4.5.10. I got NewtonSoft.Json 4.5.11 when i first installed PushSharp and I thought this version should support SocketIO4Net as well since its a higher version but i get this error whenever am trying to connect to socket.io server.
Could not load file or assembly 'Newtonsoft.Json, Version=4.0.8.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I have been banging my head all day with these dependency issues, I would be very grateful if someone can point me in the right direction.
Found solution, try with:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30AD4FE6B2A6AEED" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
You can modify assembly-binding configuration and add a redirect. See Redirecting Assembly Versions on MSDN.
Basically you want to add following snippet to your app.config or web.config file:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json"
publicKeyToken="30ad4fe6b2a6aeed"
culture="neutral" />
<!--
Assembly versions can be redirected in application,
publisher policy, or machine configuration files.
-->
<bindingRedirect oldVersion="1.0.0.0-4.5.11.0" newVersion="4.5.11.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
EDIT
Why do you need to redirect assembly versions? Even though SocketIO4Net supports newer versions of Newtonsoft.Json, it was compiled against a single version (4.0.8 in your case). This version is stored in the DLL and it is used to load DLLs SocketIO4Net depends on.
Note that NuGet dependencies are not the same as DLL/runtime dependencies - NuGet dependency on Newtonsoft.Json >= 4.0.8 only means that you will be allowed to install SocektIO4Net into a project that has a newer version of Newtonsoft.Json, it has nothing to do with runtime settings.
That being said, recent NuGet versions should add assembly-binding-redirects automatically for you if your project has app.config or web.config file.
The above solutions are correct but there is one more point that should not be forgotten: the app.config content was the same as the above solutions.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
But it's a good idea to check if it's up to date. In my case, Newtonsoft.JSON (v.6.0.4) has come to depend on another package.
There are two option;
Update (Newtonsoft.JSON package) last versions.
Update app.config file in the version numbers.
And last advice, if you are working with more than one project, eg.
exe-dll and check both versions if there is Newtonsoft.JSON.
Put in an assembly redirect in your app/web.config;
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" PublicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="1.0.0.0-4.5.11.0" newVersion="4.5.11.0" />
</dependentAssembly>
Please note the versions numbers need to match the version you have installed.
Had this same issue.
Just resolved it.
It happened after NuGet was used to install Ext.NET which has a dependency for Newtonsoft.JSON.
There was already a Newtonsoft.JSON.dll file in /bin (and obviously a reference to it in the web.config file) folder without checking I started the NuGet Package-Install procedure while debugging(so the file probably had a lock).
On the runtime error window it will tell you on the stack trace what part of the manifest it has a problem with, mine was major version so I checked the install package version. and it was 1 major version out. Found the original NuGet file under: "[physical path]/../packages/Newtonsoft.Json.[version]/lib/[.net version]/"
Both Manifest and Library was there so copied it into /bin folder, updated the root web.config assembly information and it worked.
Code samples:
Before
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
After
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
Hope this helps
In my case, I removed the package with NuGet and installed a fresh one. Then, remove the reference from References and add again manually. Works like charm. Hope resolve for you.
I was working on an old project recently. I needed to update our Newtonsoft.Json.dll, since I had to utilize a "new" API which required a newer version, but I still had other DLLs that required the old version.
bindingRedirect you say? Nope. It kept complaining about the manifest mismatch.
Separate codeBase tags? Nope. It kept complaining about the manifest mismatch.
The problem was, apparently, that the old version of Newtonsoft.Json.dll (3.0.0.0) does NOT have a PublicKeyToken, but the "new" version (4.5.7.1) DOES have a PublicKeyToken. Therefore they couldn't share the same dependentAssembly-tag.
This is what I ended up with:
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="" culture="neutral"/>
<codeBase version="3.0.0.0" href="bin\Newtonsoft_Old\Newtonsoft.Json.dll" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<codeBase version="4.5.0.0" href="bin\Newtonsoft.Json.dll" />
</dependentAssembly>
Got the above Error: in Visual Studio 2013
To Fix: In package mamnager Execute: Install-package newtonsoft.json
This will add a new line in packages.config
<package id="Newtonsoft.Json" version="6.0.5" targetFramework="net45" />
Remove the previous line which might point to previous version on packages.config.
Delete the old version's directory on the packagers directory.
Remove the reference of NewtonSoft.Json and readd it pointing to the latest version.
Root webconfig will have the following
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
once everything is done. Close and reopen visual studio.
This should fix it.
I had the same error when installing
PM> install-package durandal.starterkit
I used the above method to fix.
I have fixed this issue easily: I had not copied the xml configuration file from the compilation folder.
I just made sure that the xml configuration file was also included along with my program and everything worked fine!
Just had this happen with TeamCity and I imagine others will soon experience this. This probably applies to most build servers that pull NuGet packages.
All the answers that say to do redirects are correct. However, you need to still define the correct version number. My project was using Newtonsoft.Json 7.0, however, they had just released 8.0 and TeamCity was pulling down 8.0 which was causing issues only on the server and not locally. All my redirects were set to 7.0.
Make sure that the deployed application is actually getting the correct version from NuGet and not just the latest and greatest. Or update your config to point to the newest version.
Other solutions didn't work for me. Although I had different nuget package (Newtonsoft.Json.Schema version=3.0.0.0).
So my project was an ASP .NET project and the Newtonsoft.Json.Schama package was referred in a .NET Standard project. The solution was simply to add the Nuget package to the WEB (or startup) project too, and the problem disappeared.

I can't use the System.Runtime 4.3.0 in a .net 4.7 project

I have a .net 4.7 project which has installed the version 4.3.0 of System.Runtime. But when I run the project I get an exception that say that it can't be found the version 4.1.0.0.
If I go to the nuget manager, I install the version 4.1.0.0 in the project, then it works. So I have tried to update again to the version 4.3.0, but again, I get the problem.
The project was working until now, really I don't know why it stops to work because I don't touch anything related with the nuget packages.
Also I have tried to created a new empty solution and add the project, to try a fresh solution, but the problem is the same.
How could I solve the problem?
Thanks.
NuGet should generate the necessary binding redirects into the App.config for packages.config based projects or set AutoGenerateBindingRedirects to true for csproj files using PackageReference to reference NuGet packages.
If for some reason this did not happen or you are using the libraries from a different project / application, it may be necessary to add the binding redirect manually to the app.config / web.config file:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Google Drive SDK System.Net.Http.Primitives Version 1.5.0.0 instead of 2.1.10.0

Just downloaded a fresh copy of google-drive-v2-rev82-csharp-1.4.0-beta.zip and added a reference to Google.Apis.Drive.v2.dll in my VS 2012 C# project. I also added references to all the dll's in the Lib folder of the zip file. When I run the project it complains that version 2.1.10.0 of System.Net.Http.Primitives was found when it expected version 1.5.0.0. I tried adding the following to App.config but it still crashes when ran:
<runtime>
<assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentassembly>
<assemblyidentity name="System.Net.Http.Primitives"
culture="neutral"
publickeytoken="b03f5f7f11d50a3a"/>
<bindingredirect newVersion="2.1.10.0" oldVersion="1.5.0.0"/>
</dependentassembly>
</assemblybinding>
</runtime>
Am I just missing some concept or is there a different file I need to be downloading or what?
I am using an upgraded version of the Nuget packages and was getting the same error. I copied the following line to the application host configuration and that worked for me :-).
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="1.5.0.0" newVersion="4.2.22.0" />
</dependentAssembly>
Located under assemblyBinding tag within runtime tag.
Please follow our instructions in the Build wiki page. I recommend you to use NuGet to get the 3rd party packages (including Microsoft.Net.Http package)
This did not work for me. What I did to fix this was to go to Visual Studio menu option Tools > Library Package Manager > Manage NuGet Packages For Solution. From there find the package "Microsoft HTTP Client Libraries" and click on it. The "Manage" button will appear; click on it. Find your package that is having the error and select it and then press ok. It should work.
A little history ...
Now, this is a strange error. I built a Google API extract and tested it using a web page and everything worked. I then built a Console App project. All this console app project had in it was a call to the same static method of the same class in a class library that my web page called but I had the error described above. I added the references in my app.config with no luck in the same way the GeneBene did. After I added the package manually to the console app it worked but I never had to do this with my web application. I must say, I am not really liking this NuGet. I have had all kinds of strange problems with it.
If you are doing an worker role for azure, just include an app.config and the following code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.2.18.0" newVersion="2.2.18.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Categories