| Author |
Message |
jprice2269
Joined: 02 Dec 2007 Posts: 7
|
Posted: Sun Dec 02, 2007 4:58 pm Post subject: Could not load file or assembly 'RedGate.SQLCompare.Engine |
|
|
I am trying to do a database compare, as soon as I instantiate any class that refers to the Redgate Toolkit, I get
Could not load file or assembly 'RedGate.SQLCompare.Engine, Version=6.2.1.36, Culture=neutral, PublicKeyToken=7f465a1c156d4d57' or one of its dependencies. An attempt was made to load a program with an incorrect format.
I dont get to execute any code, just inistantiate a class that refers to the dlls.
I have read other posts and have checked that all Dlls are coming from the same directory, In my case the SQL compare directory.
Its still a trial version, will buy it as soon as I can get it to sort of run, the actual compare tool itself still shows 14 days left, is this a licensing issue maybe?
Is this an issue with VS2008, which i'm using?
John Price |
|
| Back to top |
|
 |
richardjm
Joined: 20 May 2005 Posts: 359 Location: Red Gate Software Ltd
|
Posted: Mon Dec 03, 2007 9:36 am Post subject: |
|
|
It could well be a problem with VS2008 as we've not done any testing with it yet. Try using VS2005 and see if it works.
HTH _________________ Richard Mitchell
Project Manager
Red Gate Software Ltd |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6348 Location: Red Gate Software
|
Posted: Mon Dec 03, 2007 11:03 am Post subject: |
|
|
It sounds like it could be related to calling the 32-bit RedGate.SQLCompare.Engine.dll from an application that's 64-bit aligned. Is that possible? _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
jprice2269
Joined: 02 Dec 2007 Posts: 7
|
Posted: Mon Dec 03, 2007 6:37 pm Post subject: |
|
|
Yes, its possible, its running on a 64 bit machine with a CPU type of Any... That may be picking 64 as the default, it shouldnt be, but maybe it is.... Will try forcing to 32 bit and let your know...
If thats the case, is there a 64 version of the toolkit dlls, as the rest of the project takes advantage of 64 bit processors.... Shame to reduce that for this reason... and saves me having to to the work to split this process out of the main app!
Jp |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6348 Location: Red Gate Software
|
Posted: Mon Dec 03, 2007 6:44 pm Post subject: |
|
|
Hi JP,
I'm sure it will work when set to 32-bit. CPU=Any will probably produce an executable that will run on 32-bit machines and not on 64-bit, well, at least when the code attempts to load the 32-bit SQLCompare dll.
We haven't split the assemblies into 32 and 64-bit versions as yet. I can't say if or when this would happen. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
jprice2269
Joined: 02 Dec 2007 Posts: 7
|
Posted: Tue Dec 04, 2007 12:57 am Post subject: |
|
|
The 32 bit switch fixed that issue, however i now have a different problem.
I can connect to a sqlexpress database using the connectionstring
Data Source=.\SQLEXPRESS;AttachDbFilename="QCM.mdf";Integrated Security=True;User Instance=True
however, when I call Register on the sqltoolkit, using
_connectionProperties = New Engine.ConnectionProperties(".\SQLEXPRESS", "QCM.mdf")
_connectionProperties.IntegratedSecurity = True
m_db2.Register(_connectionProperties, default)
It tells me that I cant connect with the user name "[machinename]\[windowsusername]"
where [machinename] is my pc name and [windowsusername] is who i'm logged in as.
It would be elpful to be able to pass a connectionstring in rather than the individual data....
any ideas..? |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6348 Location: Red Gate Software
|
Posted: Tue Dec 04, 2007 11:26 am Post subject: |
|
|
ConnectionProperties accepts a server, database, and optionally a username and password. It does not support attaching an MDF file. Omitting the username and password will force integrated Windows authentication, but you cannot specify an account with Windows auth, and them's the rules.
As a workaround, you can try adding the attachdb parameter into the server name, which will effectively let you attach an MDF to the SQLEXPRESS instance so that you can compare to it. The method for formatting the server connection string is described here. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
|