If you are using the SQL Comparison SDK in an ASP.NET application, web service, or website, you may encounter errors when licensing the application.
When you first compile an application using the SQL Comparison SDK, a dialog box is displayed prompting you to enter a serial number. The license information you enter is embedded in an assembly. Subsequent builds will succeed silently, and users will not be prompted for licensing information.
ASP.NET 2.0 compiles dynamically, so you cannot follow this standard licensing procedure for web applications.
To use the SQL Comparison SDK in ASP.NET applications, you are recommended to create a separate library (DLL) containing the SQL Comparison SDK functions you want to use. This DLL can be licensed normally when it is compiled, and then referenced in the ASP.NET project.
It may be necessary to license your application using the .NET Framework SDK, for example if the application is compiled by an automated build server. Instructions for this are provided below.
Note that it is not currently possible to license an ASP.NET application if you are using the 14 day free trial version of the SQL Comparison SDK. To license a web application, you must have a valid serial number, or contact support.
Licensing using the .NET Framework SDK
To license an ASP.NET application that uses the SQL Compare API:
Create a text file called License.txt, listing the licensed components. In this example, type:
and save the file to the folder containing the source code for the project.
From the Visual Studio command prompt, use the License Compiler to create the .licenses file:
/i:<module> specifies the location of the components referenced by /complist. In this example, there is only one: RedGate.SQLCompare.Engine.dll
To specify additional components, use a separate /i switch for each one.
- Enter the serial number when prompted.
From the Visual Studio command prompt, use the Assembly Linker to embed the .licenses file in a library:
- Copy the library ApplicationName.Licenses.Resources.dll into the Bin folder of the web application.
Licensing is now set up.
For more information on using the .NET framework SDK, refer to your .NET Framework documentation.