Could not load file or assembly 'RedGate.SQLCompare.Engine
jprice2269
Posts: 9
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
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
Comments
HTH
Project Manager
Red Gate Software Ltd
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
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.
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..?
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.