SQL Comparison SDK

Latest version: 10.0

SQL Comparison SDK

Knowledge Base

Manually licensing Red Gate assemblies

Category: Licensing & activation
Date: 15 Jun 2010
Product: SQL Comparison SDK
Versions: SQL Toolkit 3-6, SQL Comparison SDK 7.x

SQL Comparison SDK allows you to use the comparison and synchronization logic of SQL Compare and Data Compare in your own .NET projects. In order to use a SQL Comparison SDK-based application, however, licensing must be performed at build-time. This is done automatically by Microsoft Visual Studio when a 'licenses.licx' file is detected, but it is also possible to licence your application manually from the command prompt. This is useful if you do not develop using the Visual Studio IDE or are experiencing difficulty in getting the licensing to work as it should.

Licenses for SQL Comparison SDK are created using lc.exe, which is part of Microsoft's .NET Framework Software Development Kit (SDK). Lc.exe creates a file which needs to be built into your .NET assembly as an embedded resource. These are the steps for performing licensing of a schema comparison project called MyApp.exe from a command prompt, completely outside of Visual Studio.

- Launch a Visual Studio command prompt from the Tools menu of the Visual Studio program group
- Change directory to your project folder where your project's source code is located
- Create a new text document for the licence information:

notepad licence.txt

Enter these contents into licence.txt:

RedGate.SQLCompare.Engine.Database, RedGate.SQLCompare.Engine<return>

Note that if you were also referencing Data Compare's engine, you would mention it on the next line:
RedGate.SQLDataCompare.Engine.ComparisonSession, RedGate.SQLDataCompare.Engine

Save the file and exit.

Run the licence compiler:

lc.exe /target:"MyApp.exe" /complist:"licence.txt" /i:"c:\program files\red gate\sql compare 7\RedGate.SQLCompare.Engine.dll"

Note again that if your project also references the Data Compare libraries, they should be included in the references here as well by adding this to the command above:
/i:"c:\program files\red gate\sql data compare 7\RedGate.SQLDataCompare.Engine.dll"

-- (This produces a file called MyApp.exe.licenses)
-Now, compile the application, including your .licenses file as an embedded resource:

csc /res:"MyApp.exe.licenses" /out:"MyApp.exe" /r:"c:\program files\red gate\sql compare 7\RedGate.SQLCompare.Engine.dll" /r:"c:\program files\red gate\sql compare 7\RedGate.Shared.SQL.dll" /r:"c:\program files\red gate\sql compare 7\RedGate.Shared.Utils.dll" *.cs

Document ID: KB200708000115 Keywords: SQL,SDK,licenses.licx,licence,lc.exe,resource,compile,build

Was this article helpful?

Search support
Forums

SQL Comparison SDK

all SQL products

all products