SMO code support for both SQL 2005 and SQL Server 2008

Prepared a manged C # DLL using SMO builds version: 10.0.0.0 from SQL 2008, and I named the functions in this DLL from unclaimed C ++ code. This application runs successfully for SQL Server 2008, but this application throws an exception when I start SQL Server 2005 as follows:

Description: Failed to load file or assembly "Microsoft.SqlServer.Smo, Version = 10.0.0.0, Culture = neutral, PublicKeyToken = 89845dcd8080cc91" or one of its dependencies. The system cannot find the specified file.

What is the reason?
Is it possible in sql 2005 because of the mismacth SMO version?
How can I support sql 2005 and sql2008 in my application using one C # dll?

+5
source share
1 answer

Earlier, I faced the same problem, do you run this application from the same computer on which 2008 and 2005 are installed?

If not, I suggest you install the SMO libraries for Sql 2008 on the machine / client on which you are running the assembly.

This download will give you libraries

+3
source

All Articles