SMO code support to both sql 2005 and sql 2008
Prepared a manged c# DLL using assemblies of SMO of version:10开发者_运维技巧.0.0.0 of SQL 2008 and I called the functions in this DLL from an unmanged c++ code. This application is running successfully for SQL Server 2008 but this application is throwing exception when i run for SQL Server 2005 as follows:
Description: Could not 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 file specified.
What would be the reason?
Is it failing in sql 2005 because of the version mismacth of SMO? How can I give support to sql 2005 and sql2008 in my application using a single C# dll?I faced the same issue before, are you running this application from the same machine where you have 2008 and 2005 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 the libraries
精彩评论