Generating XML documentation in ASP.NET 2.0

N

Noman Ali

Hi,

It seems that ASP .NET 2.0 does not support XML documentation feature. Is
there any way to do this?
I serached alot and only find this solution but it didnot works for C#.

Here it is.

http://www.carljohansen.co.uk/codelib/copyappcodexml/

I contacted the Author amd the communication is.






--------------------------------------------------------------------------------

From: Carl Johansen [mailto:[email protected]]
Sent: Sunday, October 29, 2006 6:18 PM
To: Noman Ali
Subject: Re:



Hello,



I never fully investigated the problem for C# because I was not using it,
but I remember at the time that I concluded that it did not seem to be
possible for C#. This is because of the difference in the form of the /doc
switch on the vb and C# compilers.



Here are extracts from the documentation for the doc switch:



==========================

*** VB compiler (vbc.exe) ***



/doc[+ or -]
' -or-
/doc:file



+ | -
Optional. Specifying +, or just /doc, causes the compiler to generate
documentation information and place it in an XML file. Specifying - is the
equivalent of not specifying /doc, causing no documentation information to
be created.



file
Required if /doc: is used. Specifies the output XML file, which is populated
with the comments from the source-code files of the compilation. If the file
name contains a space, surround the name with quotation marks (" ").



*** C# compiler (csc.exe) ***



/doc:file



file
The output file for XML, which is populated with the comments in the source
code files of the compilation.
==========================



So we can see that the VB compiler has the [+ or -] option and the C#
compiler does not. Therefore, our only option in C# is to supply a specific
file name (eg /doc:mydocumentation.xml). This is bad news for ASP.NET,
because when we build an ASP.NET project the compiler is invoked many times.
If every invocation uses the same documentation target file name then we
will get the file for the last invocation only (all the previous ones will
be overwritten!)



It looks like some hack is required. If you could detect each creation of
mydocumentation.xml and make a copy of it before it is overwritten then you
could have an answer. It might be that App_Code is always compiled first
and therefore you only need to grab the first one - I'm not sure. I have
tried a couple of ideas, eg using a different extension for cs files in
App_Code, but with no success. One complex hack could be to write a fake
csc.exe that outputs the arguments passed to csc by Visual Studio or
aspnet_compiler and then invokes the real csc.exe. Then you could make your
own call to csc.exe for the App_Code, passing the correct arguments plus a
/doc.





Good luck,

Carl Johansen



----- Original Message -----

From: Noman Ali

To: (e-mail address removed)

Sent: Friday, October 27, 2006 10:21 PM





I read your article

HOWTO: Generate XML Source Code Comments for Visual Studio 2005 ASP.NET
Visual Basic Website App_Code assembly
I have the similar problems.



I tried to apply the solution but I am using C# and cannot convert this line



compiler language="vb;vbs;visualbasic;_vbscript" extension=".vb"
type="Microsoft.VisualBasic.VBCodeProvider, System, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" compilerOptions="/doc+
/optionstrict+"/>



what is its equivalent for C#?





Noman Ali
Software Engineer

Softech Worldwide LLC
Karachi, Sindh 74500 Pakistan

Work: 021-2787703
Mobile: 0300-2603526
Email: (e-mail address removed)
IM: (e-mail address removed) (MSN)
Professional Profile


See who we know in common
Want a signature like this?
 
W

Walter Wang [MSFT]

Hi Noman,

As LosManos suggested, SandCastle is recommended way to generate
documentation and help files based your .NET 2.0 code (NDoc only supports
.NET 1.1).

However, please note that SandCastle is still in development.

#Sandcastle Help File Builder - The Code Project - .NET
http://www.codeproject.com/useritems/SandcastleBuilder.asp
A GUI for creating projects to build help files with Sandcastle and a
console mode tool to build them as well.

#Download details: Sandcastle - September 2006 Community Technology Preview
(CTP)
http://www.microsoft.com/downloads/details.aspx?FamilyId=E82EA71D-DA89-42EE-
A715-696E3A4873B2&displaylang=en
Enabling managed class library developers throughout the world to easily
create accurate, informative documentation with a common look and feel.

Sincerely,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
N

Noman Ali

Is it compatible with ASP .NET 2.0
I want to generate XML file of comments as it possible in desktop
applictions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top