Red Gate forums :: View topic - Could not load file or assembly 'RedGate.SQLCompare.Engine
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Toolkit Previous Versions
SQL Toolkit Previous Versions forum

Could not load file or assembly 'RedGate.SQLCompare.Engine

Search in SQL Toolkit Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
jprice2269



Joined: 02 Dec 2007
Posts: 7

PostPosted: Sun Dec 02, 2007 4:58 pm    Post subject: Could not load file or assembly 'RedGate.SQLCompare.Engine Reply with quote

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
View user's profile Send private message
richardjm



Joined: 20 May 2005
Posts: 395
Location: Red Gate Software Ltd

PostPosted: Mon Dec 03, 2007 9:36 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Brian Donahue



Joined: 23 Aug 2004
Posts: 6678

PostPosted: Mon Dec 03, 2007 11:03 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
jprice2269



Joined: 02 Dec 2007
Posts: 7

PostPosted: Mon Dec 03, 2007 6:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6678

PostPosted: Mon Dec 03, 2007 6:44 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
jprice2269



Joined: 02 Dec 2007
Posts: 7

PostPosted: Tue Dec 04, 2007 12:57 am    Post subject: Reply with quote

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
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6678

PostPosted: Tue Dec 04, 2007 11:26 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group