Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy SMO application to workstation without SQL Server 2008 installed

I am trying to deploy an application that uses SMO on a workstation without SQL Server installed on it. The instance the app is connecting to is SQL Server 2008. The application is failing with:

Could not load file or assembly 'Microsoft.SqlServer.Replication, Version 10.0.0.0, Culture=neutral, PublicKeyToken=89845cdc8080cc91' or one of its dependencies. An attempt was made to load a program with an incorrect format.

The assembly in question is in the same path as my application as well as system32. I am running this on a Windows 7 64 bit box. I have run SQL Native Client, CLR, and SMO MSIs from the 2008 SMO redist download page.

This app worked fine when connecting to SQL Server 2005.

What gives?

like image 581
Matt Avatar asked Dec 08 '25 09:12

Matt


1 Answers

It looks to me like you are referencing SMO Version 10 in you project, but the client machine you are trying to deploy your application to is probably running SMO version 9. I had this same problem and updated my project references to reference SMO verison 9. I also set the SMO objects to copy local = true to ensure the correct assembly was referenced on the client machine.

like image 181
dretzlaff17 Avatar answered Dec 09 '25 23:12

dretzlaff17