SQL Comparison SDK
Latest version: 10.0
Knowledge Base
Licensing ASP .NET applications
Category: Licensing & activation
Date: 11 Mar 2009
Product: SQL Comparison SDK
Integrating the Red Gate SQL Toolkit API into a web application is possible, but there are some restrictions regarding the licensing.
When a licence is purchased for SQL Toolkit, this allows a developer to produce applications containing schema and data comparison synchronization logic without the need to activate the product on every computer where the application is deployed. This is done by embedding a permanent licence into a .NET assembly as a resource in the assembly file.
Because ASP .NET 2.0 compiles dynamically, this causes an issue with the licensing that does not affect pre-compiled assemblies because ASP .NET applications cannot interact with the user session in order to activate the software.
The recommended solution is to create a stand-alone class library to perform all of the SQL Toolkit API functions and reference this dll from the ASP .NET page code. When the class library is built on your development computer, the licence will be embedded into the dll and there will be no need to activate SQL Toolkit wherever the dll is used.
If it's not practical or possible to modify the code, ASP .NET applications can still be licensed using the .NET Framework SDK (which comes installed with the full versions 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.ComaprisonSession, RedGate.SQLDataCompare.Engine)
· Save the file and exit.
· Run the licence compiler:
lc.exe /target:"WebApplication1.Licenses.Resources.dll" /complist:"licence.txt" /i:"c:\program files\red gate\sql compare 7\RedGate.SQLCompare.Engine.dll"
If both SQL Compare and Data Compare are being referenced, append the following to the above command:
/i:"c:\program files\red gate\sql data compare 7\RedGate.SQLDataCompare.Engine.dll"
· After executing this command, you will be asked for your serial number so that the licence can be created by product activation
· Use the Assembly Linker to create a resource dll:
al /t:lib /embed:WebApplication1.Licenses.Resources.dll.licenses /culture:neutral /out:WebApplication1.Licenses.Resources.dll
· Copy WebApplication1.Licenses.Resources.dll into the Bin folder of the web application. This should dynamically link the licenses in automatically every time ASP .NET decides to compile the web application.
Document ID: KB200804000234 Keywords: SQL,Toolkit,licence,ASP,activation
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