我试图通过NuGet将MVVM Light添加到现有项目中但是我收到此错误消息:
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.
我尝试将我的项目重定向到.NET framework 4.0,4.0客户端配置文件和4.5。有任何想法吗?最近两周前我没有遇到这个问题。
答案 0 :(得分:12)
今天遇到同样的问题。尝试首先在Visual Studio Addins中安装最新版本的Nuget!
答案 1 :(得分:2)
我能够在定位4.5时安装并使用Nuget仅用于" MVVM Light Libraries"
首先安装https://www.nuget.org/packages/CommonServiceLocator/1.2.0是否可以避免此问题?
答案 2 :(得分:1)
我有同样的问题。更新了Visual Studio 2012到更新4,再次尝试,它完美地工作。祝你好运!
答案 3 :(得分:0)
听起来您的项目针对.NET 4.0,而您安装的库与目标版本不兼容。
请找到适当的库版本并安装它们