Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem commenting block of code with comments?
Message
From
05/11/2012 11:44:35
 
General information
Forum:
ASP.NET
Category:
Visual Studio
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01556399
Message ID:
01556400
Views:
42
The comments you already have are useless. The Div says the same thing. Code should be self-documenting, meaning as few comments as possible. Here's a good example of where comments aren't needed.


>Hi everybody,
>
>In VS 2012 RTM I am trying to comment out this block of code
>
>
> <div id="ContactsInfo">
>        @*Contact 1*@
>        
>        <div id="Contact1">
>            
>         @Html.EditorFor(model=>model.Contact1)
>         
>        </div>
>
>        @*Contact2*@
>        <div id="Contact2">
>            
>           @Html.EditorFor(model => model.Contact2)
>        </div>
>    </div>
>
>I've tried Ctrl+K, Ctrl+C and also tried doing it from the menu, but nothing happens, the block stays not-commented. Is it because I already have comments? Can this be considered a bug in VS IDE?
>
>UPDATE. After I removed that inner comments, I was able to comment successfully. I guess I should report this on Connect website.
>
>UPDATE 2. Posted on Connect https://connect.microsoft.com/VisualStudio/feedback/details/770103/commenting-block-of-code-with-embedded-comments-does-not-work
>
>Thanks.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform