I recently moved from VS 2017 to VS 2019. Since upgrading I've been unable to open any .sqlproj projects in VS as they all refuse to load with the error -
Could not load file or assembly 'Microsoft.SqlServer.Management.SqlParser, Version=15.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
Here's the interesting part. The Fusion Log shows me -
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.SqlServer.Management.SqlParser, Version=15.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///c:/program files (x86)/microsoft visual studio/2019/enterprise/common7/ide/extensions/microsoft/sqlcommon/130/Microsoft.SqlServer.Management.SqlParser.dll.
LOG: Assembly download was successful. Attempting setup of file: c:\program files (x86)\microsoft visual studio\2019\enterprise\common7\ide\extensions\microsoft\sqlcommon\130\Microsoft.SqlServer.Management.SqlParser.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Microsoft.SqlServer.Management.SqlParser, Version=13.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: The assembly reference did not match the assembly definition found.
I read this as :
- I need to load version 15 of this dll
- It's not in the GAC
- I am going to look under the ...sqlcommon\130 directory
- I've found the dll
- It's the wrong version, 13 not 15
I can see the dll under the c:\program files (x86)\microsoft visual studio\2019...\sqlcommon\150 directory which (I think) should be the correct version. Anyone have any idea why is it probing the 'wrong' directory and how can I get it to look in the correct one?
Any pointers in the right direction whould be hugely appreciated.