Same Engine.dll, different code?

Automate and integrate using the SQL comparison API

Moderator: Chris Auckland

Same Engine.dll, different code?

Postby ccollins » Mon Aug 17, 2009 9:18 pm

In a C# .Net solution, how do you add the same reference name to the same project, but different file?


File \\BUILD\\LOGS\\Build1987000_Release.log:
c:\\LCSDEV\\clr\\exe\\win32\\RedGate.SQLDataCompare.Engine.dll: warning CS1701: Assuming assembly reference 'RedGate.SQLCompare.Engine, Version=7.1.0.182, Culture=neutral, PublicKeyToken=7f465a1c156d4d57' matches 'RedGate.SQLCompare.Engine, Version=8.0.0.309, Culture=neutral, PublicKeyToken=7f465a1c156d4d57', you may need to supply runtime policy
c:\\LCSDEV\\clr\\exe\\win32\\RedGate.SQLDataCompare.Engine.dll: warning CS1701: Assuming assembly reference 'RedGate.Shared.Utils, Version=7.1.0.39, Culture=neutral, PublicKeyToken=7f465a1c156d4d57' matches 'RedGate.Shared.Utils, Version=7.3.0.25, Culture=neutral, PublicKeyToken=7f465a1c156d4d57', you may need to supply runtime policy
c:\\LCSDEV\\clr\\exe\\win32\\RedGate.SQLDataCompare.Engine.dll: warning CS1701: Assuming assembly reference 'RedGate.Shared.SQL, Version=7.1.0.39, Culture=neutral, PublicKeyToken=7f465a1c156d4d57' matches 'RedGate.Shared.SQL, Version=7.3.0.25, Culture=neutral, PublicKeyToken=7f465a1c156d4d57', you may need to supply runtime policy
ccollins
 
Posts: 50
Joined: Wed Jun 22, 2005 7:49 pm

Postby Brian Donahue » Tue Aug 18, 2009 10:37 am

Hi Clifton,

I have never been able to update a reference without right-clicking references and adding the reference in again. The VS Project stores the assembly's full name when you add a reference, so you's probably need to tinker with the project by writing an add-in or some bit of code to manually manipulate the .csproj file.

I suppose solution number 2 would be to use some build tool like MSBUILD or NANT to do the build for you, skipping the csproj file entirely and scripting all of the files and references to be compiled.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

possible resolution

Postby ccollins » Tue Aug 18, 2009 6:45 pm

Using the highest dll versioned file from folders, SQL Compare and SQL Data Compare, copy to a common location for your solution.

Reference the files from the common location for your solution.

Alter the application's app.config, adding the following:

<runtime>
<!-- BEGIN RedGate SQL Compare 8 SDK redirects -->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="RedGate.Licensing.Client" publicKeyToken="7F465A1C156D4D57" culture="neutral"/>
<bindingRedirect oldVersion="2.7.0.3" newVersion="2.7.0.6"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="RedGate.SQLCompare.Engine" publicKeyToken="7F465A1C156D4D57" culture="neutral"/>
<bindingRedirect oldVersion="7.1.0.182" newVersion="8.0.0.309"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="RedGate.Shared.Utils" publicKeyToken="7F465A1C156D4D57" culture="neutral"/>
<bindingRedirect oldVersion="7.1.0.39" newVersion="7.3.0.25"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="EnvDTE" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="RedGate.Shared.SQL" publicKeyToken="7F465A1C156D4D57" culture="neutral"/>
<bindingRedirect oldVersion="7.1.0.39" newVersion="7.3.0.25"/>
</dependentAssembly>
</assemblyBinding>
<!-- END RedGate SQL Compare 8 SDK redirects -->
</runtime>
ccollins
 
Posts: 50
Joined: Wed Jun 22, 2005 7:49 pm

Alternate/other applications referencing exe

Postby ccollins » Tue Aug 18, 2009 6:47 pm

If you have an other / alternate application that uses the solution, (either dll or exe), for methods, then the other application will require the entries in it's app.config.
ccollins
 
Posts: 50
Joined: Wed Jun 22, 2005 7:49 pm

Postby Brian Donahue » Wed Aug 19, 2009 10:18 am

That's a good tip. You have to use care with binding redirection though, because if functions are changed or depricated in the new version, then the applicaiton compiled against the older version will not work correctly.

API versions 7 and 8 are pretty similar in terms of the functions provided, so you can probably get away with this in the short-term.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am


Return to SQL Comparison SDK Previous Versions

Who is online

Users browsing this forum: No registered users and 1 guest