Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install protobuf-net on Visual Studio 2012 using NuGet?

I would like to install protobuf-net using NutGet and Visual Studio 2012.

However, if I try to install it, I got the following error message from NuGet :

'protobuf-net' already has a dependency defined for 'NETStandard.Library'.

I have tried to install NETStandard.Library but there is an error :

The 'NETStandard.Library 1.6.0' package requires NuGet client version '2.12' or above, but the current NuGet version is '2.8.60318.667'.

I also tried to update NuGet (by uninstalling it then re-install), but it seems with Visual Studio 2012 it is stuck to 2.8 version.

like image 488
tigrou Avatar asked Dec 19 '22 14:12

tigrou


2 Answers

I don't have Visual Studio 2012 to test, but I wonder if this is due to the way Nuget now works with the .Net Core dependencies. It should work if you install an older version of protobuf-net. You can see that the older version doesn't mention .NETStandard as a dependency. To do this, from the package manager console, type this:

Install-Package protobuf-net -Version 2.0.0.668
like image 117
DavidG Avatar answered Dec 24 '22 01:12

DavidG


I found that this protobuf-portable-net works on .NET 4.5 for VS 2013 and has the same version number as above: 2.0.0.668. It's the same author and might be a better approach than intentionally installing an old version of a newer package. enter image description here

like image 24
Zorgarath Avatar answered Dec 24 '22 03:12

Zorgarath