You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
C# compiler options specifies web.config as the only place where compiler options are set #4192
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.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: 1e1ea586-7719-df69-7d8a-8a04cddb5543
Version Independent ID: 691a6e9e-00ea-6210-c64a-659ba7930bec
@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.
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.
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 NuGet/Samples#39.
This issue has been closed as part of the issue backlog grooming process outlined in #22351.
That automated process may have closed some issues that should be addressed. If you think this is one of them, reopen it with a comment explaining why. Tag the @dotnet/docs team for visibility.
Activity
mairaw commentedon Jan 29, 2018
@eduard-malakhov thanks for your feedback. Yes, that is incorrect. We'll investigate to see all options where you can set those.
BillWagner commentedon Jan 29, 2018
@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.
9 remaining items
ztl8702 commentedon Apr 1, 2020
Ping. Any updates? I would like to know how C# compiler options can be set using the dotnet cli.
Thraka commentedon Apr 6, 2020
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 -helpztl8702 commentedon Apr 7, 2020
Thanks @Thraka . In case anyone ran into the same issue: I was trying to set the
/rcompiler option for extern alias. I found a workaround at NuGet/Samples#39.fsinisi90 commentedon Jul 22, 2020
Seems like a lot of time to remove a sentence...
dotnet-bot commentedon Jan 25, 2021
This issue has been closed as part of the issue backlog grooming process outlined in #22351.
That automated process may have closed some issues that should be addressed. If you think this is one of them, reopen it with a comment explaining why. Tag the
@dotnet/docsteam for visibility.