Answered by:
CSC options (references)

Question
-
User791773689 posted
Hello everybody,
I want to generate a documentation for my project. So far as I know, this requires to use the compiler online, with the -doc option :
CSC *.cs -doc:docfile.xml
Thanks to a german site I learned about the colon character, otherwise I only had "incorrect syntax".
But with this syntax, every reference has to be declared on the command line.
I have to explore the possibilities to have the references stored for several uses of the command.
In the help I see "@<file> : Read response file for more options"
And I presume a folder can be given for several references, for a shorter command line.
Does anyone have enough experience on that to be quicker than I for that exploration ?
__
A little more precise : in the project I have this reference
<PackageReference Include="Microsoft.AspNetCore.App" />
So, in the references folder of the project, I find Swashbuckle.AspNetCore (4.0.1), then I depress F4, then in the path property I find
C:\Users\(user)\.nuget\packages\swashbuckle.aspnetcore\4.0.1
With the file explorer I find the path of the dll in that folder, and I put this in options.txt :
-reference:AspNetCore=C:\Users\(user)\.nuget\packages\swashbuckle.aspnetcore\4.0.1\lib\netstandard2.0\Swashbuckle.AspNetCore.dll -reference:Microsoft.AspNetCore=C:\Users\(user)\.nuget\packages\swashbuckle.aspnetcore\4.0.1\lib\netstandard2.0\Swashbuckle.AspNetCore.dll
I am said that Microsoft.AspNetCore is not a valid identifier, so I suppress the second line.
Then, amongst all the messages relating to other references, I get this :
Program.cs(7,17): error CS0234: The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
Hum, there is also a Microsoft.AspNetCore.App reference, with path :
C:\Users\(user)\.nuget\packages\microsoft.aspnetcore.app\2.1.6
in which I find no dll (it seems only paths to dll files are accepted).
And I have to admit a certain perplexity.
Monday, September 16, 2019 7:48 AM
Answers
-
User475983607 posted
What is your question? Are you asking how to output an XML file from your code comments?
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, September 16, 2019 10:53 AM
All replies
-
User475983607 posted
What is your question? Are you asking how to output an XML file from your code comments?
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, September 16, 2019 10:53 AM -
User791773689 posted
Hello,
Oh nice, much more simple than what I thought.
I presume it still has an interest to be able to use the command line, but for the sake of it, so it is much less urgent.
Thank you.
Monday, September 16, 2019 11:20 AM -
User753101303 posted
Hi,
You are not using VS? With the proper verbose flag in "tools", "options" you should be able to see which command line is launched by VS and start from that.
Seems you are looking for https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/response-file-compiler-option. It's been a while but if I remember I had once a reference.rsp file with one -reference by line and thn use csc @reference.rsp.
Monday, September 16, 2019 11:20 AM -
User791773689 posted
Hello,
It seems you mean there is a checkbox in the options dialog box that enables verbose compilation ?
Do you have any idea in what tab ? And I presume the output is in the output window ?
Oh, in "Build and Run", I found "MSBuild project build output verbosity",
and "MsBuild project build log file verbosity".
Seems this answers my both questions.
Then I think your link can appear useful, thanks.
Monday, September 16, 2019 1:39 PM -
User791773689 posted
Perhaps one more question, getting back to the generation of the xml doc file.
Each procedure receives tags such as [AllowAnonymous], [HttpGet], [HttpPost].
If I want them in the documentation, do I have to copy them to the summary ?
Is it possible to get a different field for them ?
Monday, September 16, 2019 2:25 PM