For methodA(), I want to use the /// xml documentation system. I want to document that methodB() should be called before methodA().
Supposing someone renamed methodB() to renamedMethodB(), I want the old methodB() reference in the comments to be updated to renamedMethodB(). Supposing someone deleted methodB() (and assuming nothing else used methodB()), I want the program to not compile, or at least generate a warning on account of the methodB() comment then referring to a method that doesn’t exist anymore.
I’m sure I saw an example of this someplace, so I think its possible. How do I do it?
If the user use the refactoring menu of Visual Studio, he will have the option to search in strings and comments the method. If he doesn’t, there is no option to do this automatically.
To reduce the risk of missing renaming, always use the
<see cref="OtherMethod"/>construct in your comments. If the method name can’t be resolved, a warning will be produced.Example :
This code will produce a warning.
PS: I assume the Build Xml documentation option is activated in the project properties, but I’m confident it is if you have asked such question.