I have a small app which references the Microsoft.SqlServer.Smo assembly (so I can display to the user a list of servers & databases to which they can connect).
My application originally referenced Microsoft.SqlServer.Smo and Microsoft.SqlServer.ConnectionInfo. Things worked as expected on my dev box.
When I installed the application on a test machine, I received a System.IO.FileNotFoundException. The details of the message included the following: Could not load file or assembly Microsoft.SqlServer.SmoEnum
I eventually resolved the issue by referencing the following assemblies in addition to the ones mentioned above:
Can anyone confirm that I do indeed need to include each of these additional assemblies in my application (and therefore install them on user's machines) even though the app builds fine on my development box without them referenced?
SQL Server Management Objects (SMO) is a collection of objects that are designed for programming all aspects of managing Microsoft SQL Server. SQL Server Replication Management Objects (RMO) is a collection of objects that encapsulates SQL Server replication management.
C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies is the correct folder location (or C:\Program Files (x86)\Microsoft SQL Server\100\SDK\Assemblies on 64-bit systems).
C:\WINDOWS\assembly\GAC_MSIL\Microsoft. SqlServer. ConnectionInfo.
SQL Server Management Objects (SMO) are . NET objects introduced by Microsoft as of Microsoft SQL Server 2005, designed to allow for easy and simple programmatic management of Microsoft SQL Server. Using SMO, . NET programmers can design applications similar in functionality to Microsoft's SQL Server Management Studio.
You need to install two MSI files on a target machine, namely:
1) SQLSysClrTypes.msi [this one is needed for C# -> SMO GAC]
2) SharedManagementObjects.msi
For SQL Server 2014 you can dowload these here.
Also, you must make sure that the version is correct. These two files can be found with a little bit of googling. This way you don't copy anything to local & they will be resolved from GAC.
I know that this is old question, but the answers weren't satisfactory.
Yes, they do need to be included. On the development machine you probably have SQL Server installed, which places those assemblies into the Global Assembly Cache. Whenever you build, Visual Studio just pulls from them from the GAC. It also assumes that the GAC of whatever computer it will be deployed on will also have those files. If not, it throws the FileNotFound exception.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With