Skip to content

C# compiler options specifies web.config as the only place where compiler options are set #4192

Closed

Description

@eduard-malakhov

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.

Activity

  1. mairaw commented on Jan 29, 2018

    @mairaw
    Contributor

    @eduard-malakhov thanks for your feedback. Yes, that is incorrect. We'll investigate to see all options where you can set those.

  2. added this to the milestone on Jan 29, 2018
  3. BillWagner commented on Jan 29, 2018

    @BillWagner
    Member

    @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.

  4. modified the milestones: , on Apr 2, 2018
  5. modified the milestones: Sprint 134 (4/7/2018 - 4/27/2018), on May 21, 2018
  6. modified the milestones: , on Sep 24, 2018
  7. modified the milestones: , Backlog on Dec 17, 2018
  8. 9 remaining items

  9. ztl8702 commented on Apr 1, 2020

    @ztl8702

    Ping. Any updates? I would like to know how C# compiler options can be set using the dotnet cli.

  10. Thraka commented on Apr 6, 2020

    @Thraka
    Contributor

    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

  11. ztl8702 commented on Apr 7, 2020

    @ztl8702

    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.

  12. fsinisi90 commented on Jul 22, 2020

    @fsinisi90

    Seems like a lot of time to remove a sentence...

  13. added
    won't fixIssues that were closed as part of automated backlog grooming
    on Jan 25, 2021
  14. dotnet-bot commented on Jan 25, 2021

    @dotnet-bot
    Contributor

    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.

  15. removed
    won't fixIssues that were closed as part of automated backlog grooming
    on Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions