开发者

Compiler error building Monoflector

I tried building Monoflector in Visual C# Express, but the Monoflector.Data project fails to build with compiler errors:

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' accepti开发者_StackOverflow中文版ng a first argument of type 'System.ComponentModel.PropertyChangedEventHandler' could be found (are you missing a using directive or an assembly reference?)

The first error occurred in one file (ModelCollection.cs) and the second occurred in two files (ModelCollection.cs and ModelObject.cs).

My first thought was that it's somehow pulling an old version of Cecil that I had on this machine, but my old Cecil code is in a subdirectory that's not on any search path. I expanded out the references in Solution Explorer and none of them had warning icons on them.

Is anyone else able to compile Monoflector? If so, what's your configuration, and did you have to make any changes to get it to compile?


I found the extension method it was looking for. It's defined in GlobalDispatcher.cs in the Monoflector.Data project, but it's inside an #if WPF block.

To get it to build, all I had to do was right-click on the Monoflector.Data project, click Properties, go to the Build tab, and set "Conditional compilation symbols" to "WPF".

The project does have the "WPF" symbol defined, but only in the "Debug" configuration; it looks like full Visual Studio would have gotten this same compiler error in a "Release" build. VC# Express always compiles for "Release".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜