0

How do you get the XML documentation strings from .NET assemblies using IronPython? Using '_doc_' doesn't seem to be the way.

MessageBox.Show(Label().Bottom.__doc__) returns "Represents a 32bit signed integer."

How do I get the actual doc string, which should be "get the distance, in pixels, between the bottom edge..."

John_Sheares
  • 1,404
  • 2
  • 21
  • 34
  • Comments are not included in the compiled assembly. You would have to use an XmlReader to access the .XML file produced by the compiler. – Morten Mertner Dec 28 '12 at 21:46
  • I was hoping not to do that way and thought there would be a built in way of doing it. – John_Sheares Dec 28 '12 at 21:52
  • Sadly, I don't think there is. Having comments in assemblies would also significantly impact memory usage, load times, download sizes, etc. And XML is fairly easy for tools to parse, without having to know about .NET assemblies. – Morten Mertner Dec 28 '12 at 21:58
  • Just found this according to Dino: If the XML file is in the same location as the assembly and has the same filename just with ".xml" instead of ".exe" or ".dll" then IronPython should pick it up and include it in relevant doc strings for types, methods, etc.... – John_Sheares Dec 28 '12 at 23:01
  • I think that refers to VS IntelliSense, but I'm not familiar with IronPython, so they may have built something on their own. But it sounds very unlikely to me. – Morten Mertner Dec 28 '12 at 23:23

1 Answers1

0

I just found out that you need to have the XML documentation in the same directory as the exe, dll and it will be picked up by IronPython. See here:

IronPython use C# module documentation

Community
  • 1
  • 1
John_Sheares
  • 1,404
  • 2
  • 21
  • 34