5
votes

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?

1
It looks like it is failing because of version mismatches - I've had this problem too and would love to know the answer! - justinlatimer

1 Answers

3
votes

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