Geeks With Blogs

News

View Anthony Trudeau's profile on LinkedIn

Add to Technorati Favorites


Anthony Trudeau

It's been a long time since I've done a post or had any motivation to do so.  Much of that is due to events that turned my life upside-down for a time.  However, I can concentrate on other things now that I'm shaking off the shackles and things are looking brighter.

With that in mind here are a couple of random tips for Visual Studio.  These tips work specifically in Visual Studio 2010; however, it's possible they may be relevant to past and future versions.

Tip #1: Editor does not work correctly for CSHTML files

I frequently have the issue where backspaces and carriage returns stop working when I'm editing a CSHTML file.  This appears to be a common bug in Visual Studio.  The quickest way that I've found to temporarily resolve the bug is to go to a CS file (which I have open anyway), save it (whether it needs it or not), and then go back to the CSHTML file.  At that point I have the use of those keys again.

Tip #2: Getting rid of the pesky validation errors for HTML 5

MVC 3 by default uses HMTL 5 markup.  This includes tags such as section, header, and footer.  Visual Studio by default uses a much older standard for validation.  Therefore, you will get a bunch of warnings/errors such as:

Validation (XHMTL 1.0 Transitional): Element 'section' is not supported.

You can easily change the target for the validation in the Visual Studio options.  In this case, I use the HTML 5 option in the HTML Validation settings.  The path to this is: Tools > Options > Text Editor > HTML > Validation.  Select the target from the drop-down list and then click OK.

Posted on Monday, December 12, 2011 3:20 PM Visual Studio | Back to top


Comments on this post: A couple of Visual Studio tips

# re: A couple of Visual Studio tips
Requesting Gravatar...
Thank you for the tips .
Left by Tanjil Islam on Dec 12, 2011 4:12 PM

# re: A couple of Visual Studio tips
Requesting Gravatar...
Thanx man :-)! Saved me searching.. God bless ya, Andy
Left by andy on Jul 31, 2012 9:22 AM

Your comment:
 (will show your gravatar)


Copyright © Anthony Trudeau | Powered by: GeeksWithBlogs.net