ComparisonSession still prompting for license/trial copy

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.

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    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>
  • 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.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    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.
  • 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.
Sign In or Register to comment.