For large XML files it seems like the Visual Studio text editor will not attempt to do syntax highlighting, so everything is black and white.

Is there a way to force it to parse for highlighting?

  • Just how large are we talking about here? – Karan Nov 23 '12 at 21:32
  • @Karan I'm sorry, it's 14MB. – Louis Dec 16 '12 at 2:37
  • 1
    Actually, I just noticed the Output window shows a warning: 'file.xml' is too large to open with XML editor. The maximum file size is '10' MB. Please update the registry key 'HKCU\Software\Microsoft\VisualStudio\11.0_Config\XmlEditor\MaxFileSizeSupportedByLanguageService' to change the maximum size. Changed that fixed it =! – Louis Dec 16 '12 at 2:41
up vote 2 down vote accepted

It turns out the maximum file size for the XML editor is 10 MB. After changing the limit in the following key, syntax highlighting is back with no noticeable performance issues:

HKCU\Software\Microsoft\VisualStudio\11.0_Config\XmlEditor\MaxFileSizeSupported‌​ByLanguageService

Run regedit to navigate to that path in the Windows Registry. HKCU stands for HKEY_CURRENT_USER.

Run this in powershell for VS 2017 and higher

$vsWherePath = Join-Path ${env:ProgramFiles(x86)} "Microsoft Visual Studio\Installer\vswhere.exe"
$installPath = &$vsWherePath -all -latest -property installationPath
$vsregedit = Join-Path $installPath 'Common7\IDE\vsregedit.exe'
& $VsRegEdit read "$installPath" "HKLM" "XmlEditor" "MaxFileSizeSupportedByLanguageService" string
& $VsRegEdit set "$installPath" "HKLM" "XmlEditor" "MaxFileSizeSupportedByLanguageService" string 100
& $VsRegEdit read "$installPath" "HKLM" "XmlEditor" "MaxFileSizeSupportedByLanguageService" string

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.