Disable Visual Studio code formatting in Razor

后端 未结 9 1186
死守一世寂寞
死守一世寂寞 2020-12-13 17:13

This has been asked before: Why doesn't Visual Studio code formatting work properly for Razor markup?

But that question is a couple years old. And Razor formatti

相关标签:
9条回答
  • 2020-12-13 17:54

    What did the trick for me was pressing CTRL+Z after pasting, then the formatting is removed.

    0 讨论(0)
  • 2020-12-13 17:58

    In my case R# ended up being the culprit, can be disabled here:

    ReSharper > Options > Code Editing > Razor > Editor & Formatting

    https://www.jetbrains.com/help/resharper/2016.1/Reference__Options__Languages__Razor__Editor.html

    0 讨论(0)
  • 2020-12-13 18:03

    Under Tools -> Options -> Text Editor -> HTML -> Advanced

    there is a key value item Paste which says "Format on paste" and has a boolean value next to it. Changing this to false has disabled formatting on paste for me in razor syntax.

    I am using VS Professional 2013, Version 12.0.30110.00 Update 1

    0 讨论(0)
提交回复
热议问题