How to stop Visual Studio from auto formatting certain parts of code?

disable auto indent visual studio code
visual studio 2017 disable code formatting
visual studio disable smart indent
vscode disable format on save for file
visual studio format on save
visual studio 2019 not auto formatting
how to enable auto indent in visual studio
visual studio do not auto format

This seems like it should be really simple to do but I just can't figure it out. I want to allow Visual Studio to keep auto formatting my code as it is, except for this part:

public SomeClass : BaseClass {
    public SomeClass() 
        : base()
    {

    }
}

Why can't I have it look like this instead:

public SomeClass : BaseClass {
    public SomeClass() : base() {

    }
}

I looked through Tools -> Options -> Text Editor -> C# -> New Lines and can't find it. Is there a way I can change it to allow auto formatting and my second example?

Are you sure that unchecking:

Options -> Text Editor -> C# -> Formatting -> New Lines -> Place Open Brace on new line for types

doesn't do what you want?

and also uncheck

Place open brace on newline for methods.

(nvrmind.. I see what you are getting at... It is annoying)

How to stop Visual Studio from auto formatting certain parts of code , Are you sure that unchecking: Options -> Text Editor -> C# -> Formatting -> New Lines -> Place Open Brace on new line for types. doesn't do� Disabling auto formatting doesn't disable auto formatting windows 10.0 visual studio 2017 version 15.5 editor C++ James Robertson reported Feb 18, 2018 at 07:08 PM

AFAIK there is no way to prevent Visual Studio from doing this.

unwanted automatic formatting on { in Visual Studio 2017 15.5 , Visual Studio 2017 15.5 introduced a unwanted automatic formatting on { and there is no way to disable it. over 50 million developers working together to host and review code, manage projects, and build software together. In today's case of unwanted auto formatting code when we're going to look at #region when I type #reg or #end (and use Intellisense (Tab key to Complete). The first line of code directly beneath it (and any XML Comments in between) are automatically reformatted. This is despite having ALL auto formatting options DISABLED.

You purchase ReSharper and use that for all of your formatting, you can set it up exactly how you want it =)

Stop Auto Formatting My Code III - #regions, In the latest 15.5 version Visual Studio has regressed a bug where all Auto Formatting Options are disabled and yet it auto formats code around� Tools -> Options -> Web Essentials -> HTML -> Auto-format HTML on Enter (Requires installation of Web Essentials extension) Set to False. Tools -> Options -> Text Editor -> HTML -> Advanced -> Format on Paste Set to False. With these settings I have no trouble in Visual Studio 2013.

Disable code formatting for some part of code by using specific , Disable code formatting for some part of code by using specific Visual studio will then not revert their changes while formatting the file. I see, this would be for even the silent auto-formats that don't report diagnostics. To open this dialog box, click the expander arrow next to the code cleanup broom icon and then choose Configure Code Cleanup. After you've configured code cleanup, you can either click on the broom icon or press Ctrl + K, Ctrl + E to run code cleanup.

How to disable all auto-formatting / auto-indentation?, LET ME WORRY ABOUT HOW MY CODE IS FORMATTED!! In Visual Studio ( tested with VS 2010) in order to turn off the html formatting :. By automatically formatting, you can save yourself an extra click with every paste. Save even more time by automatically formatting on save In addition to being able to format on paste, VS Code lets you format each time you save a file. Similar to formatting pasted text, formatting on save requires a formatter, such as Prettier or Beautify.

How to Turn off auto formatting in Visual Studio, finally now my code won't be filled up with garbage thank you so much. Read more. Show less Duration: 0:41 Posted: Feb 25, 2020 Visual Studio Code Tips and Tricks "Tips and Tricks" lets you jump right in and learn how to be productive with Visual Studio Code. You'll become familiar with its powerful editing, code intelligence, and source code control features and learn useful keyboard shortcuts.

Comments
  • I'm guessing is does that so that when you have a wide class definition the call to the base constructor is not hidden 'off screen'
  • Those don't do it for me in VS2013. I've tried a bunch of those settings but no luck as yet. See here: stackoverflow.com/a/17477948/1061602
  • +1 Why the down votes? That is an excellent answer, seeing as M$ VS insists on formatting your code one way or another, rather than allowing Your Code to be left exactly in the format that you (as it's User god Master Overlord, infintely superior Being) proceeded to write it down.
  • yup, set the tooling to do the formatting just the way you want it, share the format rules with the team and no formatting issues.
  • Gets down voted because the answer is solved by "throwing money" at the problem. ReSharper is not free and not all IT departments have the budget to buy every little tool that might be useful. The price tag is very hefty. Starting at $300 per year! jetbrains.com/resharper/buy/#edition=commercial
  • you mean the same IT department that purchased everyone Visual Studio / MSDN licenses? my first job wouldn't purchase me a license as well, i ended up buying a personal license because my sanity was that valuable.