1

My machine: Windows XP (x86), VS2008, .net 3.5, sql server 2005, WinForms -> App works fine.

Production Machines: Windows 7 (x64), SQl Server 2005 Express -> App Starts but throws exception

Visual Studio Targeting x86 on setup project and RMO project. Visual Studio gives me a a couple warnings but I can still build:

Unable to find dependency 'MICROSOFT.SQLSERVER.MANAGEMENT.SQLPARSER' (Signature='89845DCD8080CC91' Version='10.0.0.0') of assembly 'Microsoft.SqlServer.Smo.dll'

Unable to find dependency 'MICROSOFT.SQLSERVER.MANAGEMENT.SQLPARSER' (Signature='89845DCD8080CC91' Version='10.0.0.0') of assembly 'Microsoft.SqlServer.Management.SmoMetadataProvider.dll'

This is a simple RMO (Replication Management Objects) app that initiates a pull subscription in SQL Server 2005 and displays status. Works fine on my machine, but fails on the production machine. I'm using a setup project to install the app on the production machine, but I think I'm missing a dependency somewhere, but I can't figure it out. On the production machine the app starts fine, but when I try to synch the subscription i get:

System.IO.FileNotFoundException: The Specified module could not be found. (Exception from HResult: 0x8007007E) 

EDIT: Task Manager in Win 7 inditcates that it is running as a 32-bit app (myapp.exe *32).

EDIT: Ok, my app is now showing in task manager that it is a 64 bit app, but I'm getting an error. I'm thinking that I some how have a dependency dll targeting x86. How can I verify the dependency dll is targeting the correct platfrom and/or make sure that it is targeting x64... I thought the setup prjoect would rebuild the dll in my detected dependencies to target whatever cpu I chose in the setup project?

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

AGoodDisplayName
  • 5,543
  • 7
  • 35
  • 50

2 Answers2

0

run Fusion Log viewer as administrator and set it to Log Bind Failures to Disk.
that way you'll be able to see which DLL's don't load properly.

Mladen Prajdic
  • 15,457
  • 2
  • 43
  • 51
0

I thought the setup prjoect would rebuild the dll in my detected dependencies to target whatever >cpu I chose in the setup project

the setup does not compile any dlls for you automatically.

An attempt to was made to load a program with an incorrect format.

look here, on where to find an x64 version of 'Microsoft.SqlServer.Replication' http://social.msdn.microsoft.com/Forums/en/sqlreplication/thread/628ec2ae-c5d1-4aef-b31b-b889975bfc2b

Ecki
  • 1
  • 1
    thanks, but eventually ended up going with a slightly different route. I now just start a process and call replmerg.exe and pass in the appropriate arguments to get the handle the replication. – AGoodDisplayName Mar 07 '11 at 16:46