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?
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?