问题
I'm getting desperate here; I'm trying to use XML serialization with some vanilla classes in Mono. [DataContract] and [DataMember] won't resolve, and using System.XML is impossible; it's just not in the list and won't compile suggesting a missing assembly reference.
In the About-dialog I can clearly see that the System.XML library is loaded. How can I make it accessible to my project?
MonoDevelop 3.0.5
Runtime:
Mono 2.10.9 (tarball),
GTK 2.24.10,
GTK# (2.12.0.0),
Package version: 210090011
I really don't know what to do anymore, please help!
回答1:
The About dialog is indicating that it's loaded into MonoDevelop itself, since MD uses System.Xml. The list of assemblies there is purely for diagnosing problems with MD.
You need to find your project in the Solution Pad, then find the "References" folder. This isn't an actual folder, but instead is a representation of the assemblies referenced by your project. Double-click on it to get to the "Edit References" dialog, from which you can add more references. You can also get there via the "Edit references command in the right-click menu on the References folder, and in the Project menu.
来源:https://stackoverflow.com/questions/13553507/cant-use-system-xml-in-mono-even-though-about-dialog-says-its-loaded