我尝试在Visual C#Express中构建Monoflector,但是Monoflector.Data项目无法构建,并出现编译器错误:
error CS1061: 'System.Collections.Specialized.NotifyCollectionChangedEventHandler' does not contain a definition for 'Dispatch' and no extension method 'Dispatch' accepting a first argument of type 'System.Collections.Specialized.NotifyCollectionChangedEventHandler' could be found (are you missing a using directive or an assembly reference?)
error CS1061: 'System.ComponentModel.PropertyChangedEventHandler' does not contain a definition for 'Dispatch' and no extension method 'Dispatch' accepting a first argument of type 'System.ComponentModel.PropertyChangedEventHandler' could be found (are you missing a using directive or an assembly reference?)
第一个错误发生在一个文件(ModelCollection.cs)中,第二个错误发生在两个文件(ModelCollection.cs和ModelObject.cs)中。
我的第一个想法是,它以某种方式拉扯了我在这台计算机上拥有的Cecil的旧版本,但是我的Cecil旧代码位于没有任何搜索路径的子目录中。我在解决方案资源管理器中扩展了引用,但它们都没有警告图标。
还有其他人能够编译Monoflector吗?如果是这样,您的配置是什么,您是否需要进行任何更改才能进行编译?
最佳答案
我找到了它正在寻找的扩展方法。它在Monoflector.Data项目的GlobalDispatcher.cs中定义,但在#if WPF
块中。
要构建它,我要做的就是右键单击Monoflector.Data项目,单击“属性”,转到“构建”选项卡,然后将“条件编译符号”设置为“WPF”。
该项目确实定义了“WPF”符号,但仅在“Debug”配置中;看来完整的Visual Studio在“发行”版本中会遇到相同的编译器错误。 VC#Express始终针对“发行”进行编译。
关于open-source - 编译器错误构建Monoflector,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4898497/