SQL Comparison SDK
Latest version: 10.0
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?
SQL Comparison SDK
- Licenses.licx is not a valid Win32 application
- Application licensing invalidated by renaming assembly
- Excluding a table from a data comparison
- Manually licensing Red Gate assemblies
- RedGate.Licensing.Helper.dll is attempting managed execution inside OS Loader lock
- Troubleshooting SQL Comparison SDK licensing
- SQL Compare synchronization error 'Full-Text Search is not installed'
- Using SQL Data Compare mappings in projects using the API
- Licensing automated builds with NAnt
- Licensing ASP .NET applications
- Running SQL code inside SQL Comparison SDK applications
- Creating an HTML report of schema differences in C#
- Creating a synchronization script without batch markers
- Creating an HTML report of schema differences in Visual Basic .NET
- SQL Toolkit has become SQL Comparison SDK
- SQL Comparison SDK column mapping
- Executing your own SQL queries together with SDK synchronization
- Error 1603 occurring during installation
- Licensing SDK applications in Visual Studio 2010
all SQL products
- Compatibility of Red Gate tools in 64-bit environments
- Application has encountered an error and needs to close
- Error message after installing SQL Toolbelt - The description for Event ID ( 1 ) in Source ( nview_info ) cannot be found.
- Changing the temporary directory used by the installer
- Toolbelt Installer "hanging" while "scanning volumes"
- Login failing with "trusted SQL Server connection" error when using RunAs
all products
- Some Red Gate products identified as containing a trojan by Anti-Virus software
- Activation may fail with Unknown Error -1
- Product uses web help although a CHM file is available locally
- Argument exception resulting from missing environment variable
- Check for updates may fail when used through proxies
- 'Unidentified Publisher' error when repairing or uninstalling
- Licensing activates product as standard edition
- Moving Red Gate software products to another machine
- Red Gate tools log locations
- The application UI opening slowly when there is no internet access
SQL Comparison SDK
all SQL products
all products
- Red Gate product acknowledgements
- Activating your products
- Activating your products
- Red Gate bundle history
- Check for updates
- Troubleshooting Check for Updates errors
- Current versions
- Deactivating your products
- Installing Red Gate products from the .msi file
- Requesting additional activations
- Serial numbers for bundles
- Reactivating using a different serial number
- Extending your trial
- Finding your serial numbers
- Moving a serial number from one computer to another
- No response received for manual activation
- Licensing and activation resources
- Licensing and activation resources
- Troubleshooting licensing and activation errors
- Licensing and activation FAQs
- Red Gate tools log file locations
- Download old versions of products
- Download product prerequisites & utilities
- Support & upgrades
- Upgrading your software
- Upgrading FAQs

Licensing and distribution