Application cannot find Microsoft.SQLServer.SMO on SQL 2008 machine

I have code that uses Microsoft.SqlServer.Management.Smo. (Built-in to Visual Studio 2005 SP1) It works fine on SQL 2000 and SQL 2005 machines. But when it runs on a SQL 2008 machine, it throws an exception:

System.IO.FileNotFoundException: Could not load file or assembly "Microsoft.SqlServer.Smo, Version = 9.0.242.0, Culture = neutral, PublicKeyToken = 89845dcd8080cc91" or one of its dependencies. The system cannot find the specified file. File name: 'Microsoft.SqlServer.Smo, Version = 9.0.242.0, Culture = neutral, PublicKeyToken = 89845dcd8080cc91'

=== LOG: This binding begins with the default load context. LOG: Application configuration file not found. LOG: Using the machine configuration file from C: \ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 \ config \ machine.config. LOG: Post-policy link: Microsoft.SqlServer.Smo, Version = 9.0.242.0, Culture = neutral, PublicKeyToken = 89845dcd8080cc91 LOG: attempt to load a new file URL: /// C: / Documents and Settings / Automation / Desktop / Debug / Microsoft. SqlServer.Smo.DLL. LOG: attempt to load a new file URL: /// C: / Documents and Settings / Automation / Desktop / Debug / Microsoft.SqlServer.Smo / Microsoft.SqlServer.Smo.DLL. LOG: attempt to load a new file URL: /// C: / Documents and Settings / Automation / Desktop / Debug / Microsoft.SqlServer.Smo.EXE. LOG: attempt to load a new file URL: /// C:/ Documents and Settings / Automation / Desktop / Debug / Microsoft.SqlServer.Smo / Microsoft.SqlServer.Smo.EXE.

I installed SQL 2005 Backward Compatibility Pack (updated for SQL 2008) and SQL Management Objects (updated for SQL 2008)

Any suggestions.

i went through SQL Server SMO complains about the missing DLL , but it doesn’t help much.

+3
source share
3 answers

. DLL SQL 2005 SDK. ( dlls SQL 2008: http://msdn.microsoft.com/en-us/library/ms162129.aspx) , , Microsoft SQL Server 2005 Microsoft SQL Server 2008 CLR SQL Server System (2008).

+3

" Microsoft SQL Server 2008" "Feature Feature Pack" Microsoft SQL Server 2008, 2009 . (, 1 (SP1) SQL Server 2008)

0

Not sure if this was allowed, but it looks like the original poster had the "Specific Version" property set to "True" for the dll.

To fix this, select the link in the Links folder and set the Specific Version property to true.

Microsoft really moved some features to Microsoft.SMO.Extended, but this is a separate issue

0
source

Source: https://habr.com/ru/post/1711647/


All Articles