473,396 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

<include> with relative file path does not work

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

Nov 15 '05 #1
1 3279
On Fri, 14 Nov 2003 16:27:58 -0700, Alex VanderWoude <al**@computronix.com>
wrote:
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?

Well, I wasn't able to figure out how to make a reference work, so I solved
it by creating a Pre-Build action that copies the necessary files to the
same directory as the "calling" topic. Using the previous example, the
Pre-Build action copies the Generic.xml file to the SubDir subdirectory,
which allows the compiler to find the topic it's looking for while
compiling Form2 and include the relevant XML in the output file. Since the
file is copied every time a rebuild is issued, the copied file contains all
the latest text, and all is well.

Better than a poke in the eye, I suppose.

- Alex

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bil Click | last post by:
I am coding classic ASP pages in Visual Studio .Net 2003. I have a file called counties_option.asp that just has a list of options: <OPTION VALUE="030">ANSON</OPTION> <OPTION...
3
by: Adam | last post by:
Hi All, Is it possible to use includes dynamically in html. Hopefully the following example will give an idea what I am rying to do. Thanks in advance Adam <script language="javascript">
1
by: RWC | last post by:
Hey Folks! I'm having trouble with an asp page. First off, I'm new to the html / asp world, but not to software development. I'd like to minimize or "normalize" the site, so I'm trying to use...
0
by: sharpener | last post by:
I'm new to C# and to newsgroups, so please bear with a possibly foolish query. I'll try to be sensible. The results of /// <summary> ... </summary> etc. appear immediately in the Object...
10
by: vunet.us | last post by:
What is the workaround of passign a parameter to any included asp file: <!-- #Include File="file.asp" --> This obviously does not work: <!-- #Include File="file.asp?id=123" --> Thank you
13
by: Sebastian Faust | last post by:
Hi, I hava a somehow strange problem. I hope I am not wrong in this group; if this is the case please let me know. I am trying to compile a rather simple C program. As long as I use: #include...
2
by: naveeddil | last post by:
Hello, I use this command for including my ASP files into another it is working perfectly on my XP 2002 SP2, IIS server and also i upload to brinkster.com and working perfectly there but here is...
2
by: gaya3 | last post by:
Hi All, is it possible to include jsp page in jspx file? I'm having as follows... in jspx file JSPX file: <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"...
2
by: kkshansid | last post by:
i am from asp background i am very new to asp.net environment i want to know that is there any include in asp.net as in asp so that i can include connection file which is asp.net and asp files ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.