VS 2005 XML documentation

  • Thread starter Thread starter Steve Howard
  • Start date Start date
S

Steve Howard

In VS 2005, is there any way to turn on the auto-insertion of XML
documentation like you can in VS 2003?

TIA

Steve
 
To generate the xml comments file go to "XML documentation file:" under
"Output" under the "Build" tab under Project Properties.

If you mean inserting comments in your code, go directly above the member
and enter three backslashes (///) and hit enter (in VB ''').

If you are asking about something else please elaborate

Cheers
Daniel
 
To generate the xml comments file go to "XML documentation file:" under
"Output" under the "Build" tab under Project Properties.

Got that bit ...
If you mean inserting comments in your code, go directly above the member
and enter three backslashes (///) and hit enter (in VB ''').

Yup and that too.

I was working through a VS 2003 book and it showed how to have VS
automatically insert something like

////<Summary>
//
////</Summary>

before each new method or other code. The steps reported in the book are not
possible in VS 2005 and I can see no other way for it to be enabled.


Steve
 
Well, the second bit that you got, does what you want. Please elaborate.

Without telling us which "VS 2003 book" and which "steps" it describes, I
cannot help further...

Cheers
Daniel
 
Well, the second bit that you got, does what you want. Please elaborate.

No it doesn't. What I want is for the automatic insertion of basic
documentation, without any action by me. The project I am working on
requires anal amounts of documentation (it's for University) so I want to be
sure I have included documentation for everything. Automating this would
help reduce the amount of manual searching I have to do to make sure I
document everything.
Without telling us which "VS 2003 book" and which "steps" it describes, I
cannot help further...

The book is actually Microsoft Visual C# .NET Step By Step.

On returning to the book to find the instructions that I recall struggling
with, I have not yet found the right page so I cannot give you a reference.

You are right that I can get by with what I already have, but I want to be a
great programmer, and great programmers are lazy, right? ;-)


Steve
 
Well, once you have found the steps you describe we can see at what changed.

Through the project properties you can see the warning level high (and even
treat warnings as errors) and then using the task manager find all
occurrences of undocumented members. In fact, if there was a fully automated
way, you would get no warnings/errors while having empty documentation
placeholders (not a trait of a "great programmer").

Cheers
Daniel
 
Well, once you have found the steps you describe we can see at what

Still can't find it. It appears it may actually be a default setting in C#
with VS 2003. I think you said you are a VB developer ... I see threads
elsewhere that make it clear VB never had this feature in 2003, but has
access to the stuff that we both see working now in 2005.
Through the project properties you can see the warning level high (and
even treat warnings as errors) and then using the task manager find all
occurrences of undocumented members.

I can already switch this on. It gives me 150 errors, all caused by one
3rd-party class that I am using. Not one method is documented in it ... at
least not using XML.
In fact, if there was a fully automated way, you would get no
warnings/errors while having empty documentation placeholders (not a trait
of a "great programmer").

It will give warning of no placeholder, but does not seem to care if the
placeholders are empty. But empty placeholders are easy to find in a search,
whereas no placeholder is less easy (more effort, we're going for lazy here
remember) to locate and remedy.


It looks like I'll have to live with it for now because I am still not
seeing where I thought there were instructions for enabling auto-xml
insertion. I can't really justify using up more of today looking for it,
even though I know it will save time if I can get it working ... I hate that
old dichotomy!!!


Thanks for your interest,


Steve
 
with VS 2003. I think you said you are a VB developer ... I see threads
I never said that. You didn't say what language you were using so I provided
an answer to cover both VB and C# (VB had this feature via an add-in in
VS.NET 2003)
I can already switch this on. It gives me 150 errors, all caused by one
You can turn it off for that class (since it is in your project).
whereas no placeholder is less easy (more effort, we're going for lazy
here
So we are back to turning warnings on so you can locate them easy (and
filtering warnings out for classes/methods you wish to be excluded).
insertion. I can't really justify using up more of today looking for it,
When/If you find it feel free to let us know...

Cheers
Daniel
 
Steve,

No it doesn't. What I want is for the automatic insertion of basic
documentation, without any action by me. The project I am working on
requires anal amounts of documentation (it's for University) so I want to be
sure I have included documentation for everything. Automating this would
help reduce the amount of manual searching I have to do to make sure I
document everything.

Could you be referring to this?

http://www.roland-weigelt.de/ghostdoc/

Honesty, I would advise against it. Rather than auto-generate "alibi
documentation", I'd suggest getting into the habit of documenting your
code while writing it, not afterwards. That's when the triple-slash
device Daniel mentioned comes in really handy.

Regards,
Gilles [MVP].

(Please reply to the group, not via email)
 

I guess that's the add-in required for VB. No add-in is required for C# in
VS 2003.
Honesty, I would advise against it. Rather than auto-generate "alibi
documentation", I'd suggest getting into the habit of documenting your
code while writing it, not afterwards. That's when the triple-slash
device Daniel mentioned comes in really handy.

I guess you are all missing the point here. I am not trying to put in
'alibi' documentation, quite the contrary I am trying to ensure that my
documentation is complete and accurate. What I was hoping for was the
auto-generation of

////
//<Summary>
//
//</Summary>


that was put in by VS 2003. Once it is in, I can do a fast, easy search to
see where I forgot to put in any documentation where I should have. Don't
tell me you never forget. Of course this does not 'fix' places where
documentation is inaccurate or incomplete, but it will be one more tool to
help me work more efficiently.

I have been writing code for 25 years (OMG!!!) the last 10 professionally. I
know fine well that I should document well. But I also know that important
things can be accidentally overlooked, so I wanted to use this (seemingly
missing) feature to make my documentation better.


I hope this is now clear.

Thanks


Steve
 
Back
Top