Search code examples
visual-studio-2012razorcode-folding

Fold Razor Comments in VS2012


I have large blocks of code in .cshtml file that are commented using the following syntax.

@*
    ...
*@

But Visual Studio doesn't show code folding option for this block. Is there a way to do so?


Solution

  • You could have a normal html comment around this as one solution. Might not be the most elegant solution but it woorks.

    <!--@*
    
        ................
    
    *@-->