User36583972 posted
Hi vs2010junkie
As far as I know, you can try to load XmlComments from different files through the following two methods.
1: You can modify the XmlDocumentationProvider constructor to let it supports multiple files.
XmlDocumentationProvider:
/// <summary>
/// Initializes a new instance of the <see cref="XmlDocumentationProvider"/> class.
/// </summary>
/// <param name="documentPath">The physical path to XML document.</param>
public XmlDocumentationProvider(string xmlDocFilesPath)
{
//if (documentPath == null)
//{
// throw new ArgumentNullException("documentPath");
//}
//XPathDocument xpath = new XPathDocument(documentPath);
//_documentNavigator = xpath.CreateNavigator();
XDocument finalDoc = null;
foreach (string file in Directory.GetFiles(xmlDocFilesPath, "*.xml"))
{
if (finalDoc == null)
{
finalDoc = XDocument.Load(File.OpenRead(file));
}
else
{
XDocument xdocAdditional = XDocument.Load(File.OpenRead(file));
finalDoc.Root.XPathSelectElement("/doc/members")
.Add(xdocAdditional.Root.XPathSelectElement("/doc/members").Elements());
}
}
// Supply the navigator that rest of the XmlDocumentationProvider code looks for
_documentNavigator = finalDoc.CreateNavigator();
}
HelpPageConfig:
config.SetDocumentationProvider(new XmlDocumentationProvider (HttpContext.Current.Server.MapPath("~/App_Data/")));
2: You can load multiple files at the same time.
HelpPageConfig:
config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data1/XmlDocument1.xml")));
config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data2/XmlDocument2.xml")));
Best Regards,
Yohann Lu