Same Engine.dll, different code?

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

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    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.
  • 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>
  • 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.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    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.
Sign In or Register to comment.