views:

55

answers:

1

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?

A: 

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.

dretzlaff17
I am referencing SMO v10 and think I should be unless it is not supported in Win7 64 bit? I tried compiling as x86 and still no good.
Matt