Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • andrew shearer 512 posts 661 karma points
    Aug 24, 2011 @ 08:21
    andrew shearer
    0

    formatting in visual studio

    is there any way to auto-format code in cshtml file? this is probably more of a visual studio problem, but i wondered if this has already been raised?

     

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Sep 12, 2011 @ 18:22
    Sebastiaan Janssen
    0

    If you have MVC2 and MVC3 installed, you should have proper syntax highlighting and you should be able to do CTRL+K, CTRL+D to auto-format. However, I've found that the indentation most of the time gets screwed up, so I'm hoping this will improve in future updates.

  • andrew shearer 512 posts 661 karma points
    Sep 12, 2011 @ 22:36
    andrew shearer
    0

    yep ive got MVC3, but like you the indentation is a bit screwed up. i..e brackets in no way aligned with corresponding code. its always the brackets!

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Sep 13, 2011 @ 00:15
    Sebastiaan Janssen
    0

    Ah well, I usually just format and fix whatever is in the wrong place. It's a slight pain in the ass.. I'm too lazy to create a bugreport for Visual Studio though. ;-)

Please Sign in or register to post replies

Write your reply to:

Draft