Search code examples
xmlregistryvisual-studio-2017

Large XML Files in VS 2017 15.1


I am being told to ...

'sms-20170225122824.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_65fa8ce7_Config\XmlEditor\MaxFileSizeSupportedByLanguageService' to change the maximum size.

Not only does the key 15.0_65fa8ce7_Config not exist, so I created it manually (plus the sub-keys) but what type is MaxFileSizeSupportedByLanguageService?

And why doesn't it exist already?

Registry


Solution

  • Here is a small powershell to do the job for all users

    $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 set "$installPath" "HKLM" "XmlEditor" "MaxFileSizeSupportedByLanguageService" string 100
    

    If there are already settings in the users hive you can either delete them or set the value at user level - which also does not require admin privileges:

    $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 set "$installPath" "HKCU" "XmlEditor" "MaxFileSizeSupportedByLanguageService" string 100