SSMS 18.2 extension V1.6.13b does not load 'The 'FormatterPackage' package did not load correctly.' - cannot find the file Microsoft.VisualStudio.Shell.12.0
@RichardDavies and @Lukas31781 have had issues installing the SSMS extension (even latest version 1.6.13b) on SSMS 18.2. The setup completes successfully, but when opening SSMS the error The 'FormatterPackage' package did not load correctly. pops up, and the detail in ActivityLog.xml reports that:
The system cannot find the file specified. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Shell.12.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
The system cannot find the file specified. File name: 'Microsoft.VisualStudio.Shell.12.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)
at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)
at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)
WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
(from unrelated but similar-looking Issue #227)
My very limited understanding of this issue, based on some other issues I've been working on, is that:
- In my latest build environment, "Microsoft.VisualStudio.Shell.12.0" was resolving automatically to version 14.0.0.0, and therefore no longer included some of the types it should have contained, in its original version 12.0.0.0.
- The correct fix to this would have been annotating the reference with a version for disambiguation, but in my confusion and following Visual Studio's "include reference" autofix suggestion, I added a reference to Microsoft.VisualStudio.Shell.Framework instead.
- As a result, working SSMS support required the existing installation of a relatively recent version of visual studio - 2017, I think.
I think I have this fixed, but cannot test, so will appreciate some feedback shortly - I expect to have a new installer out today.
New installer available: https://github.com/TaoK/PoorMansTSqlFormatter/releases/tag/1.6.16
I wasn't able to reproduce, so I can't be sure, but I believe this should address the error. Please let me know.
For me, I have the same problem, first install msi 1.6.16 and get the same information as in version 1.6.13b, the second time I uninstall and install without any changes.
I still experience this issue with 1.6.16, unfortunately.
Recent, clean install of Windows 10 64-bit 1903, SSMS 18.2, .Net 3.5 and 2.0 installed on-demand by another application that required them. I don't have Visual Studio installed at all.
I'm still getting the same error as well with 1.6.16.
Same for me
Same for me this morning
Mine installed but the links under tools are greyed out


Same issue. PoorSQL options are greyed out. I uninstalled and reinstalled as well. The VS2017 installation is working.
SQL Server Management Studio 15.0.18142.0 Microsoft Analysis Services Client Tools 15.0.1389.0 Microsoft Data Access Components (MDAC) 10.0.18362.1 Microsoft MSXML 3.0 6.0 Microsoft Internet Explorer 9.11.18362.0 Microsoft .NET Framework 4.0.30319.42000 Operating System 10.0.18362
PoorSQL options are greyed out

SQL Server Management Studio 15.0.18131.0 Microsoft Analysis Services Client Tools 15.0.1347.0 Microsoft Data Access Components (MDAC) 10.0.17134.1 Microsoft MSXML 3.0 6.0 Microsoft Internet Explorer 9.11.17134.0 Microsoft .NET Framework 4.0.30319.42000 Operating System 10.0.17134
Hi I have the same issue

SQL Server Management Studio 15.0.18142.0 Outils clients Microsoft Analysis Services 15.0.1389.0 Microsoft Data Access Components (MDAC) 10.0.18362.1 Microsoft MSXML 3.0 4.0 5.0 6.0 Microsoft Internet Explorer 9.11.18362.0 Microsoft .NET Framework 4.0.30319.42000 Système d'exploitation 10.0.18362
I used the 1.6.16 installler
Installing SSMS 17.9 alongside 18.2 causes the extension to work! Going to do that until it's fixed; I missed this tool so much.
Installing SSMS 17.9.1 made the formatting tool work for me too in SSMS, must be a missing library or something. Love the tool too, hope this gets fixed.
Any update on when this will be fixed? (It shouldn't be marked resolved as there are still many people reporting this issue.)
The issue still exists. Clean Windows Install /w SSMS 18.3 and PoorMansSQL Installer 1.6.16
Same issue here. Any update?
There are a lot of dependency problems with the current version of SSMS 18.3.1 and the extension.
In the end I took the projects and re-referenced them against the Nuget versions of their dependencies and upped the .net version to 4.6 and built them and copied them to the X:\Program Files (x86)\PoorMansTSqlFormatterSSMSExtension folder (replace X with your drive letter) and removed the LinqBridge.dll file (seems to come free with the .net install).
Happy to share those DLLs if people want them (https://drive.google.com/open?id=1LI1nlRmlPNg1EkW-B_ydwzAzrHfbJ8m3) - not really an ideal solution but may help.
As a caveat it's had limited testing (under 5 minutes - once it worked a few times and reformatted SQL didn't really do much else) on a single newly built machine and has no guarantee of it working in your environment.
Happy to share those DLLs if people want them
This works for me on a fresh german Win10 + SSMS 18.3.1. Thanks!
@aphalon : can you make a PR? I like to use your solution as well, but randomly downloading dll's from an untrusted source doesn't make me feel comfortable 😄
Using SSMS 18.4 and Windows 10 v1903 -- I am still experiencing this problem using PoorSQL 1.6.16. "FormatterPackage' package did not load correctly." and the PoorSQL menu options are disabled. I have another PC with the same configuration, and it works fine on that unit.
Installing VS Isolated Shell solved my issue. I have SSMS 18.4 and PMSF 1.6.16
https://aka.ms/VS2015/IsoShell/en-US
Same issue here, using SSMS 18.4, Windows 10 version 1909 and Visual Studio 2019 version 16.4. The file C:\Users\{my_user_name}\AppData\Roaming\Microsoft\AppEnv\15.0\ActivityLog.xml records this message:
CreateInstance failed for package [FormatterPackage]Source: "mscorlib" Description: Could not load file or assembly "Microsoft.VisualStudio.Shell.12.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" or one of its dependencies. The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly "Microsoft.VisualStudio.Shell.12.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" or one of its dependencies. The system cannot find the file specified.
File name: "Microsoft.VisualStudio.Shell.12.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)
at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)
at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
When SSMS finishes loading, the two options for Poor SQL are grayed out under the Tools menu.
Will there be a new version that solves this in SSMS 18.4?
@jmoralesv Installing the missing "VS isolated shell" solves the issue:
Installing VS Isolated Shell solved my issue. I have SSMS 18.4 and PMSF 1.6.16
https://aka.ms/VS2015/IsoShell/en-US
Helped me too. Running SSMS 18.5, PSMF 1.6.16 and VS 16.6.0
@jmoralesv Installing the missing "VS isolated shell" solves the issue:
The issue seems to be with a binding redirect missing from SSMS.
If you edit ssms.exe.config (by default at C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE) and add the following line inside the assemblyBinding element the package will load:
<dependentAssembly> <assemblyIdentity name="Microsoft.VisualStudio.Shell.12.0" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> <bindingRedirect oldVersion="2.0.0.0-15.0.0.0" newVersion="15.0.0.0"/> </dependentAssembly>
There's one for shell 9.0, 10.0, and 14.0 just not one for 12.0. I took the above from the visual studio exe.config. This will get cleared and have to be re-done any time you update SSMS.
The issue seems to be with a binding redirect missing from SSMS.
If you edit ssms.exe.config (by default at C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE) and add the following line inside the
assemblyBindingelement the package will load:
<dependentAssembly> <assemblyIdentity name="Microsoft.VisualStudio.Shell.12.0" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> <bindingRedirect oldVersion="2.0.0.0-15.0.0.0" newVersion="15.0.0.0"/> </dependentAssembly>There's one for shell 9.0, 10.0, and 14.0 just not one for 12.0. I took the above from the visual studio exe.config. This will get cleared and have to be re-done any time you update SSMS.
This totally works!
I face the same issue on SSMS 18.6. Entries in ActivityLog.xml
<entry>
<record>120</record>
<time>2020/11/19 13:54:07.211</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Begin package load [FormatterPackage]</description>
<guid>{247609B1-2692-47D6-972A-976544685F0E}</guid>
</entry>
<entry>
<record>121</record>
<time>2020/11/19 13:54:07.373</time>
<type>Error</type>
<source>VisualStudio</source>
<description>CreateInstance failed for package [FormatterPackage]Source: 'mscorlib' Description: Could not load file or assembly 'Microsoft.VisualStudio.Shell.12.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Shell.12.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.VisualStudio.Shell.12.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
 at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)
 at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
 at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)
 at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
</description>
<guid>{247609B1-2692-47D6-972A-976544685F0E}</guid>
<hr>80004005 - E_FAIL</hr>
<errorinfo></errorinfo>
</entry>
I had the same issue and came in to say that adding the binding settings to the SSMS config file (see fix above) worked. Great add in other than the opps in install.