I am trying to <include> some text into an XML documentation topic, but
that text is stored in a file that is in a different directory than the
"current" XML file. Using a relative path does not appear to work, because
the base being used is the Common7\IDE directory, not my original source
directory.
Here is the situation:
MyApp directory contains the file Form1.cs, Form1.xml, and Generic.xml.
There is also a subdirectory called SubDir, which contains Form2.cs and
Form2.xml. In Form2.xml I want to <include> a topic from Generic.xml, like
this:
<Form2 name="Foo">
<include file='Generic.xml' path='Generic[@name="Bar"]/*' />
</Form2>
The above doesn't work, because when the overall MyApp.xml file is produced
it cannot find Generic.xml. The complaint generated by the compiler is as
follows:
c:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\Generic.xml
Badly formed XML in included comments file -- 'The system cannot locate the
object specified.'
So I tried the following:
<include file='..\Generic.xml' path='Generic[@name="Bar"]/*' />
But this doesn't work either, because as the above message implies, the
Common7\IDE directory is being used as the base from which to calculate the
relative path. Here's the error:
c:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Generic.xml
Badly formed XML in included comments file -- 'The system cannot locate the
object specified.'
As can be seen, instead of failing to find the file in the IDE directory it
now fails to find the file in the Common7 directory. But why is it looking
there instead of where my source code is?
Finally I tried hard-coding the path:
<include file='C:\Dev\MyApp\Generic.xml' path='Generic[@name="Bar"]/*' />
This worked, but it is unsatisfying because the XML files are now tied to a
particular directory location on my hard drive. A different developer on
the team might have their development tree elsewhere, and these path
references would fail to compile.
What I can't figure out is why the Common7\IDE directory is being used as
the base from which to resolve the relative paths. Is there a setting
somewhere in Visual Studio that controls this?
Regards,
Alex VanderWoude