ComparisonSession still prompting for license/trial copy

Automate and integrate using the SQL comparison API

Moderator: Chris Auckland

ComparisonSession still prompting for license/trial copy

Postby tony_mocella » Fri Feb 13, 2009 9:43 pm

I'm running up against an error where my built application is still prompting people for a license-key or the "trial expired" prompts as soon as the application gets to where it should be setting up a new ComparisonSession.

I used the article "Manually licensing Red Gate assemblies" to create a .licenses file for my application, which is set as an embedded resource in my application.

When I use Reflector to inspect my assembly, I can see that the licenses file is indeed embedded into my assembly, and that the license-key is the one I was supplied when we bought the SDK.

I'm not really sure what else I need to check to verify/understand why I'm getting prompted for a key on all machines besides my own machine.

Any pointers/assistance are appreciated.
tony_mocella
 
Posts: 3
Joined: Fri Feb 13, 2009 9:36 pm

Postby Brian Donahue » Mon Feb 16, 2009 7:24 pm

Hi,

I can think of a few reasons for an invalid licence resource. If you find the licence resource in your assembly output, then either the resource had been created with the wrong name, the assembly had been renamed, or the library being used is not licensed.

If you want to change the name of your assembly, it's necessary to completely rebuild it with the new name. Renaming a compiled assembly breaks the licensing.

The resource must also have a name that matches the assembly name, case-sensitively. If your assembly is called Foo.exe, then your licensing resource should be called Foo.exe.licenses.

If you are using SQL Data Compare, then the licence resource must contain the text RedGate.SQLDataCompare.Engine.ComparisonSession. If this is missing, maybe you have only licensed the schema components of the SQL Comparison SDK and not the data components. If you are using both, then you have to make sure that you include them both in the licenses.licx file, for instance

RedGate.SQLCompare.Engine.Database, RedGate.SQLCompare.Engine <new line>
RedGate.SQLDataCompare.Engine.ComparisonSession, RedGate.SQLDataCompare.Engine <new line>
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby tony_mocella » Mon Feb 16, 2009 7:41 pm

I'll run through the exact steps to see if you might pin-point where I went wrong.

I'm using the SDK from an assembly in my application (not the executing assembly, a class library in my solution) that we'll call "foo.domain.dll" (this has never been renamed since we created the project months ago).

Inside the foo.domain project, I've added a licenses.txt file with the following text:
RedGate.SQLCompare.Engine.Database,RedGate.SQLCompare.Engine
RedGate.SQLDataCompare.Engine.ComparisonSession,RedGate.SQLDataCompare.Engine

I opened up a command-prompt in the location where this txt file resides, and run the following (the binaries reside in the lib folder in the script):
lc.exe /target:"Foo.Domain.dll" /complist:"licenses.txt" /i:"C:\\Projects\\Trunk\\Source\\Foo\\lib\\RedGate.SQLDataCompare.Engine.dll" /i:"C:\\Projects\\Trunk\\Source\\Foo\\lib\\RedGate.SQLCompare.Engine.dll"

I add the newly created "foo.domain.dll.resources" file to my foo.domain project, and set it to be an embedded resource.

At some point, I was prompted to input my license number for the SDK which seemed to work and as I mentioned, when I run Reflector over my foo.domain.dll, I see the resources file indicating my two RedGate products from the license and later the license-key that I entered.

Again, all "works on my machine" but when I pass the contents of my bin\\ folder to another person, they receive the "trial expired" error message.

The license we purchased was for SQL Comparison SDK.

Let me know if there's any other info that can help resolve these errors.
tony_mocella
 
Posts: 3
Joined: Fri Feb 13, 2009 9:36 pm

Postby Brian Donahue » Tue Feb 17, 2009 12:33 pm

Hi,

The resource embedded in the dll should be called Foo.Domain.dll.licenses rather than Foo.Domain.dll.resources. I suspect that this could have simply been a typo.

If it is, I don't know what else to tell you. Maybe you can look into compiling with Visual Studio. When you create a file called licenses.licx and set the compile action to "embedded resource", then Visual Studio will do all of this stuff automatically at build time.

The only reasons for the "how to licence manually" are for when you want to build SDK projects on a continuous integration server or for when Visual Studio malfunctions when trying to create licenses automatically.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby tony_mocella » Tue Feb 17, 2009 5:59 pm

I've changed back to using a .licx file in Visual Studio, and the application no longer seems to prompt for "expired trial...enter license" on other machines when I deploy to other machines.

Thanks for your assistance in resolving this situation.
tony_mocella
 
Posts: 3
Joined: Fri Feb 13, 2009 9:36 pm


Return to SQL Comparison SDK Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests