开发者

How to use <include> in external comments.xml file to refer to another member. .Net

开发者 https://www.devze.com 2023-03-30 00:04 出处:网络
I know how to use the <include> keyword from my code to refer to a member in an external comments file. Something like:

I know how to use the <include> keyword from my code to refer to a member in an external comments file. Something like:

<include file="Comments.xml" path="Docs/ClassName/Members[@name='DoIt']/*" />

However, I have members in the Comments.xml file which are repeated that I would like to split out and refer to within the Comments.xml file itself. As an example, it could be an argument definition that is used multiple time.

I've tried the same format as above, but it doesn't work. Any ideas?

ETA: According to this blog post, 'Reason 3', it should work with the exact same syntax, so I'm not sure why it is not working for me. If I look at the xml file that visual studio generates, no error has been generated. In fact it doesn't look like it has even tried to include the member as my original 'include' line is still in there (but with 'path' part appearing before the 'file' part).

ETA2: I had to fix the c# example in th开发者_JS百科e aforementioned blog post to split the include-includes into a seperate xml file, otherwise a stockoverflow was generated on compilation.

I can't get it to work for me however. I'm using VB and i've tested it in 2008 and 2010 - both are express editions. This means that either the syntax is different, or the functionality is not implemented in the VB versions of visual studio.


It appears as though you want to have an element in your xml file that is included in the documentation for all of your members for a class? I've done this before, but I don't think I got the element working within the xml file. My solution was to have multiple elements in my c# code.

For example:

/// <include file="Comments.xml" path="Docs/ClassName/AllMembers/*" />
/// <include file="Comments.xml" path="Docs/ClassName/Members[@name='DoIt']/*" />
0

精彩评论

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