System.IO. FileNotFoundException: Could not load file or assembly ‘Microsoft. VisualStudio. CommandBars’

Applies to
ApexSQL Refactor

Summary
This article shows what should be done when “System.IO.FileNotFoundException” is displayed

Symptoms
When starting Microsoft SQL Server Management Studio, “System.IO.FileNotFoundException” is displayed

Cause
Some system libraries are missing in the PublicAssemblies catalog

Resolution

  1. Check whether the Microsoft.VisualStudio.CommandBars.dll library exists in one of the following locations
  2. x:/Program Files/Microsoft Visual Studio/Common/7IDEPublicAssemblies/
    x:/ProgramFiles/CommonFiles/MicrosoftShared/MSEnvPublicAssemblies/

    If there is no such file in the mentioned locations, try reinstalling SQL Server client components using the SQL Server installer

  3. Locate the folder with Global Assembly Cache Tool gacutil.exe. Execute the following CLI command in the gacutil.exe directory
  4. gacutil /l Microsoft.VisualStudio.CommandBars

    If nothing is returned, run the following command to add the missing *.DLL to the Global Assembly Cache

    gacutil /i [Full path to the Microsoft.VisualStudio.CommandBars.dll]

About ApexSQL Refactor
ApexSQL Refactor is a SQL formatter and database refactoring tool for SQL Server. Format SQL queries, refactor SQL code, database tables and much more

Last updated
July 30, 2012