I was trying to run old project on new laptop and tried solution A that did not work. But i figured out that when I installed newest version of SSMS(managment studio) it updated references in the project to use new dll versions f.e
Microsoft.SqlServer.Smo.dll,
Microsoft.SqlServer.SqlEnum.dll that need proper version of 'microsoft.sqlserver.batchparserclient'
but solution B worked out.
Solution A
https://www.microsoft.com/en-us/download/details.aspx?id=43339
Download Summary:
1. ENU\x64\SharedManagementObjects.msi
2. ENU\x64\SQLSysClrTypes.msi
https://social.technet.microsoft.com/wiki/contents/articles/35832.sql-server-troubleshooting-could-not-load-file-or-assembly-microsoft-sqlserver-batchparser.aspx
Solution B
Remove all references to Microsoft.SqlServer.SOMETHING
and replace them with the version you have registered in GAC.
F.e I had references to version 14.x dlls in my project but i had
older versions registered in GAC (C:\Windows\assembly) version 11 and 12, even though i have installed proper files from solution A (newer versions, x86, x64 you name it)
I have replaced the dlls in my project references
from C:\Program Files\Microsoft SQL Server\140\SDK\Assemblies
to C:\Program Files\Microsoft SQL Server\120\SDK\Assemblies
It is not the neatest solution for your project references but i needed it quickly to work and it did.