disable C# comment auto-indent

Jon K 0 Reputation points
2023-03-02T17:35:11.1266667+00:00

When I indent a block of code in C#, I do NOT want all of the // to be aligned with the code. Further, if I comment a block out using columns 0 and 1, and hit <ENTER>, I don't want it to auto indent.

I've found how to configure this for C++, but not C#. Is the option just not there? Or am I blind?

Developer technologies Visual Studio Setup
Developer technologies Visual Studio Other
Developer technologies C#
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 31,056 Reputation points Microsoft External Staff
    2023-03-03T09:26:42.9666667+00:00

    Hi @Jon K, 

    Welcome to Microsoft Q&A! 

    Which version of Visual Studio are you using? 

    Please go to Tools > Options > Text Editor > C# > Tabs > Indenting: None.

    You will get the format:

    User's image

    If it doesn’t meet your requirement, please kindly share me some screenshots or steps in order to investigate it further. 

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

     

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.