0

I have a 32-bit application that was developed using SQL Server 2008 Express SP2, since we are moving to Windows 10 we are going to be using SQL Server 2016 Express and I get these errors when I start the application:

Message:Could not load file or assembly 'Microsoft.SqlServer.ConnectionInfo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

I fixed these errors by installing the CLR Types and SMO's for 32-bit 2008 on my machine. I also noticed in Visual Studio that my references to Microsoft.SqlServer.ConnectionInfo, Microsoft.SqlServer.Management.Sdk.Sfc, and Microsoft.SqlServer.Smo updated their paths with the new SQL Server (before the 2008 SMO install) but I still got this error.

What can I do in the application to avoid this error? Is it just updating the references?

vee
  • 389
  • 5
  • 19
  • If you want to work with Sql Server 2016 why do you install SMO for 2008? I would install the version for 2016.https://www.microsoft.com/en-us/download/details.aspx?id=52676 – Steve Jan 24 '18 at 22:39
  • @Steve the project references v10 of the .dlls while 2016 is v14 – vee Jan 24 '18 at 22:41
  • @nessa you need to migrate your application, not just run it as is on the new OS. In particular 32bit is dead - you should be compiling and running 64 bit apps that use the appropriate libraries for 2016 and whichever version of .Net is uses. And yes - that means you might need to refactor code in your app. If you don't do this, you are not really upgrading your application. Learn from the problems you are having - there are limits to backward compatibility. A decade is far too long to wait. – SMor Jan 25 '18 at 15:07
  • @SMor I agree, i'll work on that, i'm wondering if there is a way to work with multiple versions of sql server in the same app – vee Jan 25 '18 at 16:15

1 Answers1

0

Belows exists here "C:\WINDOWS\assembly\"?

Microsoft.SqlServer.ConnectionInfo.dll
Microsoft.SqlServer.ConnectionInfoExtended.dll
Microsoft.SqlServer.PolicyEnum.dll
Microsoft.SqlServer.RegSvrEnum.dll
Microsoft.SqlServer.ServiceBrokerEnum.dll
Microsoft.SqlServer.Smo.dll
Microsoft.SqlServer.SmoExtended.dll

try this

gacutil /i "C:\Program Files\Microsoft SQL 
Server\120\SDK\Assemblies\Microsoft.SqlServer.ConnectionInfo.dll"

and

regasm "C:\Program Files\Microsoft SQL 
Server\120\SDK\Assemblies\Microsoft.SqlServer.ConnectionInfo.dll"
Hasan Jafarov
  • 628
  • 6
  • 16