Nudel
Nudel

Reputation: 21

C# Documentation <include> not found

I have a little problem I don't understand.

I wanna document my Code using Documentation comments. And I have a XML file with information about the author who wrote the part of code.

I'm using Visual Studio 2013 and have in the Project a directory named Documentation there is the file Author.xml with this structure:

<doc>
  <member name="number1">
    <remarks>some Information</remarks>
  </member>
  <member name="number2">
    <remarks>some Information</remarks>
  </member>
    ...
</doc>

In my code I have this comment

/// <summary>
/// 
/// </summary>
/// <include file='~/Documentation/Author.xml'path='doc/member[@name="number1"]/*'/>
public class ExampleClass { ... }

but in the documentation.xml is generated:

<summary>
</summary>
<!-- Der enthaltene XML-Abschnitt konnte nur teilweise oder gar nicht eingefügt werden. --><include file="~/Documentation/Author.xml" path="doc/member[@name=&quot;number1&quot;]/*"/>

that means the XML-Code couldn't be included.

I have this from a book about C# for beginners, but it doesn't work.

Please can someone help me with my problem.

Upvotes: 2

Views: 669

Answers (1)

Richard
Richard

Reputation: 109210

  <include file='~/Documentation/Author.xml'path='doc/member[@name="number1"]/*'/

I can see two problems with that:

  1. ~ does not have any special meaning in Windows paths: you would be better using a path relative to the project.

  2. You need a space between one attribute and another: change …xml'path=… to …xml' path=….

Upvotes: 4

Related Questions