Is there an easy way to reformat an XML file while viewing it Visual Studio 2010. For example, if you open a generated app.config file, it might look like:
<?xml version="1.0"?> <configuration> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
This is difficult to read, is there a way to instruct Visual Studio 2010 to format this, so that it looks more like:
<?xml version="1.0"?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> </startup> </configuration>
Thanks for any help.
Update: With credit to Julien Hoarau for one of the answers. The answers are:
Edit -> Advanced -> Format Document (Ctrl+K, Ctrl+D) Edit -> Advanced -> Format Selection (Ctrl+K, Ctrl+F)
To access XML formatting options, choose Tools > Options > Text Editor > XML, and then choose Formatting.
On Windows Shift + Alt + F. On Mac Shift + Option + F. On Linux Ctrl + Shift + I.
Right-click on the project or solution name in Solution Explorer, select Analyze and Code Cleanup, and then select Run Code Cleanup.
The XML editor in Visual Studio is based on the text editor and includes additional support for the XML languages. When you open an XML file in Visual Studio, it opens in the XML editor. The XML editor includes the following features: XML 1.0 syntax checking.
Yes you can :
Edit > Advanced > Format document (Ctrl+K Ctrl+D)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With