如何将MvvmLightLibs依赖项更改为最新的CommonServiceLocator

时间:2017-11-05 13:43:42

标签: c# wpf mvvm-light

在我的项目中,我使用mvvm light package(v 5.3.0)。一切都没问题,直到我将包CommonComLocator从版本1.3.0更新到新的(2.0.1)版本。 在此更新之后,在这样的代码中:

ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

我收到以下错误:

  

类型'IServiceLocator'是在没有的程序集中定义的   引用。您必须添加对程序集的引用   'Microsoft.Practices.ServiceLocation,Version = 1.3.0

由于我的其他软件包也使用CommonServiceLocator,我更喜欢获取最新版本。 如何让MvvmLight使用新的程序集?

1 个答案:

答案 0 :(得分:1)

  

如何让MvvmLight使用新程序集?

你不能。它依赖于旧版本。您必须等到使用MvvmLight 2.0.1的CommonServiceLocator新版本发布或恢复使用版本1.3.0的CommonServiceLocator

你不能做"制作" MvvmLight使用特定的程序集或API而无需重新编译库。