我想MVVM光添加到通過的NuGet現有的項目中添加MVVM光庫,但我收到此錯誤信息:無法通過的NuGet
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框架4.0 ,4.0客戶端配置文件和4.5。有任何想法嗎?最近兩週前我沒有遇到這個問題。
謝謝,我做了同樣的事情,並能夠得到MVVMLight安裝,但我確實需要CommonServiceLocator,因爲它增加了對我的首選IoC容器Autofac的支持。單獨安裝CommonServiceLocator仍會返回相同的錯誤消息。 – MoebiusStripMall
它與Autofac發生衝突,並且未能卸載CommonServiceLocator的Autofac版本?這是蹩腳的,但有時我會訴諸創造一個有問題部件工作的新項目,然後手動複製舊代碼。 –