Questions tagged [xml-comments]
Can refer to 1) comments in XML documents or 2) XML markup used for documentation in programming language comments.
315
questions
0
votes
1
answer
42
views
Documenting *not* overriden methods with different XML comments
I have some base class and multiple classes inheriting from it. Those derived classes usually won't override the default constructor. Nevertheless, I'd like to change the documentation of that default ...
0
votes
1
answer
78
views
How to reference a nested generic type in C# doc comments
In C# it is possible to add doc comments to methods. In the description it's possible to put a reference to another type using the <see cref="..."/> tag. When putting a generic type in ...
0
votes
0
answers
54
views
Cannot deserialize XML with xml-comment using ordered elements
If I deserialize XML which include a comment-element and it is deserialize to a class with ordered properties I get the exception:
There is an error in XML document (4, 25).
Unable to cast object of ...
0
votes
2
answers
164
views
Getting XML comments from multiple .csproj files to populate in Swagger UI
I know that similar questions have been asked here but I'm truly at a loss. I currently have around 5ish .csproj files as a part of a web application that all contain XML comments. Proj1 is the only ...
0
votes
0
answers
28
views
What is the XML comment for return with cref of ActionResult<IEnumerable<T>>
If my API function is
public ActionResult<IEnumerable<T>> GetAsync()
How do you denote the cref of the return in an XML Comment?
I tried
/// <returns><see cref="ActionResult{...
1
vote
1
answer
68
views
Mouse over variables and functions tips
I know that i need to add ///<summary> to have mouse over tips on functions and variables but is there a way to make this happen only with the // ?
In the pre-built default functions i always ...
3
votes
1
answer
238
views
xml-comments of nuget package do not show up
I have created my own nuget package:
https://www.nuget.org/packages/Chia-Client-API/
In the code of the package, I documented all functions with xaml comments:
/// <summary>
/// returns all ...
0
votes
0
answers
15
views
VS 2022 - Add multi language code summaries
I'm currently working on a growing shared codebase.
I'd like to add method summaries (XML comments) in multiple languages - the codebase has been used by Italian programmers until today, but it's now ...
0
votes
0
answers
29
views
XML <exception> comment not showing descrition
I have an xml comment on a function that throws a std::runtime_error. While the intellisense shows the exception type that is thrown, it isn't showing the description.
I searched about it but nobody ...
1
vote
1
answer
123
views
Visual Studio Refactoring changes to many things
Example: When i rename the following function
public void Foo(){}
to
public void Bar(){}
Then visual studio changes all constant strings, that contain the word "Foo" and replaces "Foo&...
1
vote
1
answer
210
views
XML comments cannot correctly reference properties named 'Item'
Given the following code:
class FixedWidthReader<T>
{
public T? Item { get; private set; }
/// <summary>
/// Populates <see cref="Item"/>.
/// </summary&...
0
votes
2
answers
96
views
How to add comments in XML using python
XML i am parsing:
<List>
<Item>
<Price>
<Amount>100</Amount>
<Next_Item>
<Name>Apple</Name>
...
2
votes
0
answers
47
views
Xml comment <example> reference generic
I'm trying to make some examples for a method but I just can't make it work. The generic parameters are never highlighted. What's the correct syntax?
/// <summary>
/// <example>
/// ...
0
votes
0
answers
68
views
C# XML comment to say 'no exceptions thrown'?
In C# XML comments, we have the <exception> tag to say that a method throws a particular type of exception.
What is the best way to tell the library users that a method does not throw any (...
0
votes
0
answers
410
views
CDATA sections and comments are lost when parsing XML with ElementTree
I am editing xml files, I ran into the problem that when changing a file in a python script, its structure is lost.
Xml file:
<?xml version="1.0" encoding="UTF-8"?>
<main&...
2
votes
2
answers
1k
views
Visual Studio 2022 not showing parameter XML docs tooltips on mouse over
As pictured, the "param" part of the summary is not showing on mouse over panel.
Should I expect them to be there or is the "param" functionality not working as I think it should?
...
0
votes
1
answer
223
views
Intelli sense not showing for custom methods with xml comments
I have an interface with XML comments on
namespace NamespaceName.Core.Services
{
public interface ITransaction : IDisposable
{
/// <summary>
/// Sends message into the ...
2
votes
0
answers
139
views
XML Comment for C# function with out parameter
C# function with out parameter.
public static bool theFunction(string param1, out ulong param2) {
param2 = 103206309L;
return true;
}
How is the out param2 properly denoted in an XML comment?
...
-1
votes
1
answer
129
views
How to write more detailed XML comments in C#?
I was writing some XML comments for some variables and discovered that if I have a short summary block, when I hover over the variable I get tooltip with that summary. However, if I have a long tag ...
0
votes
1
answer
767
views
Capturing commented text in an XML
I am trying to collect information from the World Bank. In particular, data from this website.
https://microdata.worldbank.org/index.php/catalog/3761/get-microdata
The "DDI/XML" link ...
0
votes
1
answer
199
views
VS 2019 - quick action menu items missing
I have two Win10 PC, both with the same installation VS2019 Enterpsrise(Version 16.11.15). Almost the same extensions. But in one VS installation, quick action menu and it's options look like on the ...
0
votes
0
answers
96
views
XmlReader and malformed comments
I am using this code to load XML that has the potential for errors (human edited).
$xmlReaderSettings = [System.Xml.XmlReaderSettings]::new()
$xmlReaderSettings.CloseInput = $True
$xmlReaderSettings....
0
votes
1
answer
642
views
Preserve comments outside the root element of xml file
I am updating the xml file using python xml module and I want to preserve all the comments, using insert_comment variable is preserving the comments inside root element but removing outside/end of the ...
1
vote
1
answer
704
views
Resharper avoid "Parameter has no matching param in the XML comment" for extention methods
I have a class of extension methods which I want to have good XML comments for.
An example function looks like this
/// <summary>
/// Does something cool and assigns the result to <paramref ...
2
votes
1
answer
449
views
how to read xml comment from Property in constructor?
public class MyClass {
/// <summary>
/// My awesome class
/// </summary>
/// <param name="i_a">This is test of A</param>
/// <param ...
0
votes
0
answers
858
views
How can I remove HTML comment in a .vue file?
I build a webpack project, to compile my .vue files.
Then I write some HTML comments in the .vue file, and I build file using webpack, while the mode is "production".
But when I browse the ...
0
votes
1
answer
94
views
API Documentation using XML Comments in SwaggerHub
I am trying to update API documentation for REST APIs.
Currently, I have a C# Asp.net Web API code and Swashbuckle.AspNetCore.
I am editing and adding XML comments in C# using Visual Studio to update ...
2
votes
0
answers
469
views
Adding Xml Documentation for Razor components (no code behind)
i have seen a similar question here but only with code behind:
Adding XML documentation for Razor components
am I forced to use code behind for a razor component to add Xml Documentation to it?
0
votes
0
answers
32
views
Calculating % of types and members which have XML comments
Does anyone know of an easy way for calculating what percentage of types, methods, and properties in a C# project are decorated with XML comments?
I am considering ways of improving on our code ...
1
vote
1
answer
395
views
Is it possible to change default XML comments in Visual Studio 2019+?
Before this gets marked as duplicate, I know this question has been asked in the past [1] [2], but the answers are extremely outdated and only contain workarounds and 3rd party tools.
The exact ...
0
votes
2
answers
419
views
How to use #if in an XML comment
I'm writing a library with source code common to the server and the client.
The problem I have is inside XML comments, where sometimes the client and server documentation differs, something like:
///...
4
votes
1
answer
307
views
Is there an efficient way to handle repeating XML comments C# code in Visual Studio
I am using Visual Studio for a couple of years now and we have always just written all the XML comments for our C# code manually.
But lately I recognize the need for a way to centrally maintain ...
2
votes
1
answer
208
views
How to remove a comment tag from XmlDocument with Inno Setup
I would like to remove a comment tag from a XmlDocument using Inno Setup. My xml looks approximately like this.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
...
0
votes
0
answers
67
views
XML comments for objects using WithEvents not showing
XML comments do not show up when an object instance is defined using WithEvents; however, comments will show up for everything else. How do I resolve this?
EDIT
''' <summary>
''' Represents a &...
1
vote
1
answer
1k
views
Can not found file Xml comment in Web API(.NET 5 web API)
This is a picture of the code config file path of XML comment file.
When I deploy in Azure, I have a problem that It can't find this XML file
-4
votes
1
answer
187
views
Why do some XML-Comment show up strangely?
Reproduce as follows:
Create a WPF application (.Net 4.8).
Click on the codebehind tab.
Hover over the class name (MainWindow).
You will now see a popup saying
MainWindow
instead of saying
...
0
votes
1
answer
190
views
VS2019 - Automaticly generate XML comment for methods and classes when you save the file
In Visual Studio, you can write /// to create an XML documentation comment above a C# method or class. The problem is that you have to manually type three slashes, which is too much for some ...
7
votes
1
answer
3k
views
Is there any way to preserve white space in C# XML comments?
I'm currently documenting my C# code and would find it useful to include a code block that directly shows how a piece of code should be called. I use the <code> tag that is embedded into the ...
0
votes
1
answer
290
views
xmlstartlet how can I insert <!--- comment --> line above node
I want to add a commentline inside a xml file above the node
using xmlstartlet
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<book>
<title lang=...
1
vote
1
answer
36
views
Create Variable From Commented Out XML Values With PowerShell
I have a license file with a lot of commented out fields that I need to make into variables. The different lines may or may not exist, so I need to find out if the line exists, and if it does, turn ...
2
votes
1
answer
2k
views
Configure warnings for mising xml comments in .editorconfig (Visual Studio 2019)
is it possible to configure an .editorconfig file to display warnings/errors on items with missing XML documentation?
It would be great to see such warnings in the editor.
Thanks in advance.
0
votes
1
answer
448
views
Punctuation marks in C# XML comments [closed]
Should I add punctuation marks (e. g. ".") in my c# xml comments?
In the official Microsoft xml comment documentation there is now statement.
Also you can see in that in this documentation ...
3
votes
1
answer
3k
views
Different colors in C# XML documentation comments
I'm trying to have different colors of text in the XML doc comment like how the word true, false and Window are in blue and green colors in the picture below.
I tried decompiling the code that had ...
13
votes
3
answers
2k
views
Documentation comments for properties of positional records in C#
If I have a positional record like this:
public record Version(int Major, int Minor);
it seems that I can only provide a <summary> documentation, like this:
/// <summary>
/// Version ...
1
vote
1
answer
420
views
VS2019 (16.8.1), C#, XML Comments, Intellisense not showing
I have a Xamarin Forms project (C#) that I am working on in VS2019 (16.8.1) and I have noticed that if I add XML comments to the properties of classes within the project they are not then showing up ...
1
vote
2
answers
232
views
how to add comment in xml subelement at element start
I am using lxml in an attempt to to output the following xml code:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<students>
<!--
学生信息表
...
1
vote
0
answers
67
views
What is the difference between using the C# Description attribute and XML documentation comments (triple-slash comments)? [duplicate]
Is there a difference between using the C# Description attribute and XML documentation comments (triple-slash comments)? When should I use either one?
Thanks.
/// <summary>
/// This is my class.
...
0
votes
1
answer
854
views
How can I export XML code documentation in vb.net?
In vb.net I can write an XML documentation by using some tags, like the following
'''<summary>
''' Hello there!
'''</summary>
In Java, I simply can export my Javadoc documentation in a ...
0
votes
1
answer
99
views
Is there a converter that converts XML to YAML and includes comments?
I'm trying to find a service, library, utility, whatever that converts XML to YAML and includes comments. It's easy to find a lot of XML to YAML converters, but I can't find one that includes XML ...
0
votes
1
answer
137
views
Is it possible to have a ctrl+click able link to a file with relative path in the comment
I need to link a file in a comment so that others can click it and the explorer opens the folder or the file opens
I need something like this:
/// <summary>
/// Does something see file://$(...