Visual Studio 2008 has a handy 开发者_运维技巧command "format the whole document" (ctrl+k,ctrl+d). This will clean up and auto-indent many different types of files, including .aspx, .xml, etc.
Is it possible to invoke this functionality from the command line, so I don't need to open the Visual Studio and wait for files to open?
I believe the answer is no.
The main reason being that "format the whole document" modifies the document, but does not save it. It is therefore not a destructive operation. Not only do you have the ability to check the original document (which you have open) you can also visually verify after executing the command, but before overwriting the original.
A commandline tool would be destructive with no way to check what was actually changed, it would simply be overwritten.
精彩评论