Visual Studio enlarge XML file size from 10 to 100 mb

While trying to open a large XML file with Microsoft Visual Studio you might get the following error:

“‘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\15.0_95894220_Config\XmlEditor\MaxFileSizeSupportedByLanguageService’ to change the maximum size”

To solve this, open a Powershell prompt as administrator and execute the following lines:

$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
About Normen 19 Articles
Normen is a freelance senior network security engineer specialised in Check Point Technologies solutions. If you like his articles you can buy him an espresso here

Be the first to comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.