Recently, my Visual Studio 2008(with Resharper 4.5) has started to reformat asp tags into lowercase.
Example:
<asp:Repeater runat="server" id="rp">
becomes
<asp:repeater runat="server" id="rp">
and I can’t find a way to make it not do this. I use Ctrl-k Ctrl-d to reformat.
I’ve tried resetting the Visual Studio settings, turning off Resharper. Nothing seems to bite.
I did delete a huge Reflected something folder in my Documents and Settings folder last week, could this be the reason?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Go to Tools | Options…
Expand: Text Editor – HTML
Select the “Format” node, and see what settings you have for “Capitalization” of “Server tag” and “Server attributes – I think the default is now “Lowercase” – try setting that to “Assmebly definition” instead.
More information on these options can be found here:
Method 2
I had the same (or very similar) issue.
I also deleted some (but not all) files in the folder
C:Documents and Settings[username]Application DataMicrosoftVisualStudio9.0ReflectedSchemas
The reason I did this is because I’m subject to a frankly daft limit on the size of my (Windows XP) roaming profile 🙁
After I did this VS intellisense and document auto-formatting started behaving as if it didn’t know what the <asp: tags were and treated all the html as plain html (formatted tag names and attributes in lowercase).
I found this blog post by Tim Vasil which pointed me to the solution.
Here’s what I did to fix this:
-
Deleted all files in C:Documents
and Settings[username]Application
DataMicrosoftVisualStudio9.0ReflectedSchemas -
Deleted all files in
C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary
ASP.NET Files - Deleted the .suo User Option file (the file has the same name as the solution file with .suo in place of .sln)
(Note: VS eventually regenerates the various files in it’s own time…)
Method 3
I found the cause. I put back that 650MB big folder in C:Documents and SettingsMy User IdApplication DataMicrosoftVisualStudio9.0 and everything seems to be back to normal.
Thanks for trying to help me!
Method 4
I’m not sure about a permanent fix, but what you can do is select the troublesome coding then hit CTRL+K followed by CTRL+F, so in order..
CTRL + K, F
This will auto format the coding (and make it the proper case).
If this doesn’t work then it might be an auto-format issue/setting
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0