I am trying to install Humanizer (see also GitHub and NuGet Gallery pages) using the NuGet package manager inside Visual Studio 2010. The documentation suggests it should support .NET 4+.
Issuing the following command on a brand new empty MVC4 project:
PM> install-package Humanizer
Gives me the following result:
Successfully installed 'Humanizer 1.26.1'.
Successfully uninstalled 'Humanizer 1.26.1'.
Install failed. Rolling back...
Install-Package : Could not install package 'Humanizer 1.26.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', but the package does not contain any assembly references that are compatible with that framework. For more information, contact the package author.
At line:1 char:16
+ install-package <<<< Humanizer
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommandPM>
I contacted the author directly (and subsequently raised an issue on GitHub). He mentioned that the package targets Profile136 (can also be seen in the csproj file) which should support .NET 4:
<TargetFrameworkProfile>Profile136</TargetFrameworkProfile>
I had a look around and read this SO question which discusses building portable class libraries. Having read that, I discovered that Visual Studio 2010 requires an add-in to enable building of PCLs.
I realise I'm not building here, but I installed it anyway, along with the updated reference assemblies v4.6.
Having looked in the following folder:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile
I discovered that I only have profiles up to 131, but no 136.
An answer to the SO question mentioned earlier suggests that 136 was added in the Windows Phone SDK 8.0. However I can't install this on Windows 7.
Why can't I install this package in Visual Studio 2010? Is it because I don't have profile 136 on my machine, or is that only required for building PCLs?
Note that I have installed other NuGet packages successfully, e.g. log4net.