This topic says "In Visual Studio, you set compiler options in the web.config file". Is that correct? I think this sentence is misleading as AFAIK web.config only exists for web applications.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@eduard-malakhov thanks for your feedback. Yes, that is incorrect. We'll investigate to see all options where you can set those.
@eduard-malakhov Thanks for reporting this. I'm investigating with the team about the history of that sentence, and what was meant by adding it. I'll add comments here once I've gotten those answers.
Closing this and using the new one.
@HongGit can we remove
In Visual Studio, you set compiler options in the web.config file
Ping. Any updates? I would like to know how C# compiler options can be set using the dotnet cli.
You should open up a new issue. This issue is about removing that line because it's not applicable for this article.
However, to quickly address your comment, I don't know that you can. .NET Core uses projects and MSBuild to control compiling, and you would have to explore how that works and how to customize (if you can, I don't know if you can) building specific files.
It looks like MSBuild does provide a task to invoke the compiler, I don't know if it works on .NET Core though, it may only be applicable to .NET Framework. https://docs.microsoft.com/en-us/visualstudio/msbuild/csc-task?view=vs-2019
Also, I found this via search: https://stackoverflow.com/questions/46065777/is-it-possible-to-compile-a-single-c-sharp-code-file-with-the-net-core-roslyn-c
Which indicates that you can explore the roslyn compiler included with the .NET Core SDK:
C:\Program Files\dotnet\sdk\{your-sdk-version}\Roslyn\bincore> dotnet .\csc.dll -help
Thanks @Thraka . In case anyone ran into the same issue: I was trying to set the /r compiler option for extern alias. I found a workaround at https://github.com/NuGet/Samples/issues/39.
Seems like a lot of time to remove a sentence...