Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio XML File Editor Lowercase

I'm editing cshtml in Visual Studio (with a .cshtml file extension). I auto format or paste in some xml (which triggers an auto format) and Visual Studio lowercases all my xml attributes (so theAttribute > theattribute).

This is wrong. How can I fix? I don't see a relevant option under Tools > Options.

like image 305
Jeff Avatar asked Feb 22 '14 21:02

Jeff


People also ask

How do you lowercase in Visual Studio?

To convert text to all lower case, choose Edit > Advanced > Make Lowercase or press Ctrl+U.

How do I beautify XML in Visual Studio?

To access XML formatting options, choose Tools > Options > Text Editor > XML, and then choose Formatting.

How do you change case in VS code?

Command Palette: CTRL + SHIFT + p (Mac: CMD + SHIFT + p ) type >transform pick upper/lower case and press enter.


2 Answers

I haven't found a way to configure this behavior, but as workaround you can explicitly select editor to be used with *.cshtml files and then it works properly.

Go to Tools -> Options -> Text Editor -> File Extension

enter image description here

P.S. It looks like there were plans for HTML (Razor) text editor settings in a separate node, but I don't see it in release of VS 2013. See HTML Editing Features in Visual Studio 2013 Preview

Also I saw that Tools -> Options -> Text Editor -> HTML (Web Forms) -> Formatting has options which specifically mention the behavior you are getting.

like image 77
Anton Avatar answered Oct 12 '22 19:10

Anton


You may also want to try this:

  • Options
    • Text
      • Editor
        • HTML
          • Advanced
            • Format on paste: False
            • Enable validation: False
like image 24
Tatiana Racheva Avatar answered Oct 12 '22 20:10

Tatiana Racheva