How to target multi SQL Server editions

107 views Asked by At

I have built a Windows application to backup databases.

I downloaded SQL Server 2012, I want to add Microsoft.SqlServer.Smo.dll and Microsoft.SqlServer.SqlWmiManagement.dll DLLs as references to my project to connect with SQL Server 2016 and/or SQL Server 2014. What do I need to deploy in order to achieve that?

When I added references that are not related to the same SQL Server edition I got the error :

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

Any help please?

Thanks in advance.

2

There are 2 answers

3
marc_s On

You need the newest version of the DLL's.

If you have the SQL Server 2012 version, you can connect to any server with a version up to 2012 - SQL Server 2005, 2008, 2008 R2, 2012.

If you want to connect to SQL Server 2014 and 2016, too, you must use the SQL Server 2016 versions of those SMO DLL's

0
Geovanny Hernandez On

Exactly, remember that you SMO is installed with SQL Server version that you have installed in your machine, you have to download the last version to be compatible with all previous version.

Download Microsoft SQL Server 2016 Feature Pack