SQL Comparison SDK

Latest version: 10.0

SQL Comparison SDK

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?

Search support
Forums

SQL Comparison SDK

all SQL products

all products