Unable to add MVVM Light libraries via NuGet

I am trying to add MVVM Light to an existing project through NuGet, but I am getting this error message:

Attempting to resolve dependency 'MvvmLightLibs (≥ 4.2.30.0)'.
Attempting to resolve dependency 'CommonServiceLocator (≥ 1.2)'.
Successfully installed 'CommonServiceLocator 1.2'.
Successfully installed 'MvvmLightLibs 4.3.31.1'.
Successfully installed 'MvvmLight 4.2.30.0'.
Successfully uninstalled 'CommonServiceLocator 1.2'.
Install failed. Rolling back...
Could not install package 'CommonServiceLocator 1.2'. You are
trying to install this package into a project that targets
'.NETFramework,Version=v4.0,Profile=Client', but the package
does not contain any assembly references that are compatible
with that framework. For more information, contact the package
author.

I tried redirecting my project to .NET client 4.0, 4.0 with client and 4.5. Any ideas? I did not have this problem quite recently, like two weeks ago.

+4
source share
4 answers

Today was the same problem. Try installing the new version of Nuget in your Visual Studio applications first!

+12
source

I can set while targeting 4.5 and use Nuget for "MVVM libraries only"

https://www.nuget.org/packages/CommonServiceLocator/1.2.0 ?

+2

I had the same problem. The updated version of Visual Studio 2012 for Update 4, tried again, and it worked perfectly. Good luck

+1
source

It looks like your project is targeting .NET 4.0 when you install a library that is not compatible with the target version.

Please find the appropriate version of the library and install it.

0
source

Source: https://habr.com/ru/post/1536308/


All Articles