Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: Generate code documentation xml for ASP.NET 2.0 website

Reply
Thread Tools

Re: Generate code documentation xml for ASP.NET 2.0 website

 
 
carlj
Guest
Posts: n/a
 
      05-31-2006
Back in Feb I posted a question about generating the XML file for
source code comments in an ASP.NET website. I then posted a solution
that I found. I have since been asked to provide further details, so I
have written a detailed article (including source code) in
http://www.carljohansen.co.uk/codelib/copyappcodexml . I hope this is
useful to you if you have encountered the same problem that I did.

Carl.
-----

Here are my original posts:

[ I have an ASP.NET 2.0 website in Visual Studio 2005 (ie I open it
with File
| Open Web Site...). I have put XML comments in the source code in the

App_Code directory (with <summary> tags, etc) and I want to turn these
into
XML files that can then be run through NDoc (along with app_code.dll)
to
produce help files. I've even found an (apparently stable) port of NDoc
for
v2.0 of the framework. So no problem, I'll just go to Project
Properties |
Compile and check the "Generate XML documentation file" box... uh-oh...
this
isn't a project, so there _is_ no Project Properties dialog. Hmmm,
maybe
"aspnet_compiler" has the /doc option... Nope. Wait, I know: I'll add
"/doc+" to the vbc.rsp file so that it becomes a default compiler
option...
No dice; VS and aspnet_compiler use the /noconfig option, so they
ignore the
defaults. Now what? Does this mean I can't put things in App_Code if I
want
to document them?

If that's too easy for you, then how about the same question for
code-behind
files? This one was easy in Visual Studio 2003, because these were
built
into one big /bin assembly. But in VS 2005 there seem to be two issues:
(1)
no Project Properties, so no way to set the "generate XML documentation

file" option, and (2) no obvious assembly containing the code-behind
code
that I can give to NDoc. ]

....

[ To answer my own question (for VB App_Code directories): I found a
kludgy workaround. I added a <compilers> section to my web.config (by
copying what was in my default machine.config). In it I added a
<compilerOptions> element with "/doc+" as an option. This means that
when I build the site using VS or aspnet_compiler, a file called
App_Code.xml is placed in the same random directory under
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET Files
as App_Code.dll. If you are using aspnet_compiler with an explicit
target directory, you will find that App_Code.dll gets copied to the
target directory but App_Code.xml doesn't. I wrote a post-build script

to search in Temporary ASP.NET Files and copy the latest version of
App_Code.xml (since the exact location sometimes varies from build to
build)

I suspect that this trick would not work with a C# site, because in C#
you don't have the "/doc+" option; you have to specify a filename for
the xml doc file. Since the VS/aspnet_compiler build processes consist

of multiple invocations of the compiler, only the last invocation's xml

file would be available. ]

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generate code documentation xml for ASP.NET 2.0 website Carl Johansen ASP .Net 3 01-15-2009 08:56 PM
XML documentation for website =?Utf-8?B?RXJpYw==?= ASP .Net 5 07-05-2007 10:26 PM
Java program to generate XML schema documentation? D. Alvarado Java 0 04-28-2004 09:17 PM
ASP XML Support - Generate XML string from FORM DATA based on XML schema Matt ASP General 3 04-23-2004 07:12 PM
Principles of documentation (was: Python Documentation Blows!) Cameron Laird Python 1 04-03-2004 06:54 PM



Advertisments