Skip to content

Revised xml doc comments topic for csproj - #1548

Merged
rpetrusha merged 2 commits into
dotnet:csprojfrom
rpetrusha:xmlcomments
Feb 14, 2017
Merged

rpetrusha merged 2 commits into
dotnet:csprojfrom
rpetrusha:xmlcomments

Conversation

@rpetrusha

@rpetrusha rpetrusha commented Feb 13, 2017 •

Copy link
Copy Markdown
Contributor

Revised xml doc comments topic for csproj

Summary

Revised for csproj files in .NET Core, as well as Visual Studio and .NET Framework from the command line. Also did a very, very, very quick edit pass.

Fixes #1542

@mairaw mairaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your edits @rpetrusha! Found a few things to fix.

Comment thread docs/csharp/codedoc.md Outdated
XML documentation comments, like all other comments, are ignored by the compiler.

XML documentation comments are characterized by triple forward slashes (`///`) and an XML formatted comment body.
You can generate the XML file at compile type by doing one of the following:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compile type -> compile time?

Comment thread docs/csharp/codedoc.md Outdated
<DocumentationFile>bin\Debug\netcoreapp1.0\App.xml</DocumentationFile>
```

-- If you are developing an application using Visual Studio, right-click on the project and select **Properties**. In the properties dialog, select the **Build** tab, and check **XML documentation file:**. You can also change the location to which the compiler writes the file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove one of the dashes
style guide: If a command label ends with a colon or an ellipsis, don’t include that end punctuation in instructions.

Comment thread docs/csharp/codedoc.md Outdated

-- If you are developing an application using Visual Studio, right-click on the project and select **Properties**. In the properties dialog, select the **Build** tab, and check **XML documentation file:**. You can also change the location to which the compiler writes the file.

-- If you are compiling a .NET Framework application from the command line, add the [/doc compiler option](language-reference/compiler-options/doc-compiler-option.md) when compiling.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove one of the dashes

Comment thread docs/csharp/codedoc.md Outdated
## See also
[XML Documentation Comments (C# Programming Guide)](programming-guide/xmldoc/xml-documentation-comments.md)

[Recommended Tags for Documentation Comments (C# Programming Guide)](programming-guide/xmldoc/recommended-tags-for-documentation-comments)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing .md in the link

Comment thread docs/csharp/codedoc.md Outdated

You use the `<remarks>` tag to add information about types or members, supplementing the information specified with `<summary>`.
In this example you'll just add it to the class.
The `<remarks>` tag to supplements the information about types or members that the `<summary>` tag provides. In this example you'll just add it to the class.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to supplements -> supplements
missing comma after example

Comment thread docs/csharp/codedoc.md Outdated
Good news is there's a way to let your developers know that certain methods can throw certain exceptions and that's by using the `<exception>` tag.
Looking at your little Math library you can see that both `Add` methods throw an exception if a certain condition is met, not so obvious though
By using the `<exception>` tag, you let your developers know that a method can throw specific exceptions.
Looking at your Math library you can see that both `Add` methods throw an exception if a certain condition is met, not so obvious though

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should you style Math as inline code?

Comment thread docs/csharp/codedoc.md Outdated

While documenting your code with XML tags you might reach a point where you need to add some sort of reference to another part of the code to make your reader understand it better.
The `<see>` tag is one that let's you create clickable links to documentation pages for other code elements. In our next example we'll create a clickable link between the two `Add` methods.
The `<see>` tag lets you create a clickable link to a documentation page for another code element. In our next example we'll create a clickable link between the two `Add` methods.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: missing comma after example

Comment thread docs/csharp/codedoc.md

}
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

existing typo below: intergers (it shows up more than once)

Comment thread docs/csharp/codedoc.md Outdated

As the name suggests you use the `<returns>` tag in the comment for a method declaration to describe its return value.
The `<returns>` tag describes the return value of a method declaration.
Like before this will be illustrated on the first `Add` method go ahead an implement it on other methods.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing comma after before,

the second part of the sentence needs work. It should probably be rewritten to something like:
Add method. You can do the same on other methods.

Comment thread docs/csharp/codedoc.md
@@ -1259,8 +1269,13 @@ that need to be taken into consideration when using XML documentation tags in yo

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 1248 typo: an there

@rpetrusha

Copy link
Copy Markdown
Contributor Author

Thanks for catching all of these, @mairaw! I've made the corrections, and fixed a few more things (especially that floating-point division doesn't throw a DivideByZeroException).

@mairaw mairaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Good catch on the exception, I missed that one while reviewing it. :shipit:

@rpetrusha
rpetrusha merged commit e701461 into dotnet:csproj Feb 14, 2017
@rpetrusha
rpetrusha deleted the xmlcomments branch February 14, 2017 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants