Unknown build error Cannot resolve dependency to System.Windows

后端 未结 5 1617
感情败类
感情败类 2020-12-15 02:58

I just downloaded PoshConsole\'s source code and was trying to build the solution. I initially had two problem -

  1. the System.Interactivity.dll could not be

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-15 03:25

    I would like to add some information in addition to O. R. Mapper's answer that suggests adding a reference to the assembly that is indicated by the compiler error.

    I experienced the same problem while working on a WPF project. Considering the X,Y,Z relation presented in his answer, the problem happens when binding properties with types from X to a DataTemplate with DataType from Y. So, this doesn't happen for all assemblies that are referenced by Z, but rather those that only expose their specific types within Views. In my case, I was binding SelectedItem of a ComboBox to an enum property declared in X.

    You can refactor these types to object and the problem goes away if you really want to preserve references as they should, especially if you use MVVM. Furthermore, the problem goes away by itself when you properly wrap Model types into ViewModel ones, because that generates explicit code that helps Visual Studio figure out required assemblies.

    Hope this helps.

提交回复
热议问题