Problem with embedded licenses.licx file in VS 2003 .Net

SuleonSuleon Posts: 17
edited March 7, 2008 11:48AM in SQL Toolkit Previous Versions
Hello again,

I am loosing my nerves on a licensing problem. I think it's a Visual Studio 2003 problem but maybe somebody can help me:

I want to use API from RedGate.SQLCompare.Engine and RedGate.SQL.Shared. When I try to make a synchronisation I get an exception that SQL Comparer is not reigstrated. So I followed the instructions from the toolkit help.

I added an embedded licenses.licx file to the resources of my project. I still have other license files in other projects e.g. ActiveReports, ComponentOne When I try to compile my projects I get an error message:

Error 17 "LC.exe" ended with Code -1
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets 1669 9 UptimeWinPresentation
============================================================
CompileLicxFiles

Compile .licx files (containing information about licensed controls used by the application) into .licenses files.

[IN]
@(_LicxFile) - The list of .licx files in the project (usually there will be just one)

[OUT]
@(CompiledLicenseFile) - The list of compiled .licenses files (there will be just one)
============================================================
-->
<PropertyGroup>
<CompileLicxFilesDependsOn></CompileLicxFilesDependsOn>
</PropertyGroup>
<Target
Name="CompileLicxFiles"
Condition="'@(_LicxFile)'!=''"
DependsOnTargets="$(CompileLicxFilesDependsOn)" Inputs="$(MSBuildAllProjects);@(_LicxFile);@(ReferencePath);@(ReferenceDependencyPaths)&quot;
Outputs="$(IntermediateOutputPath)$(TargetFileName).licenses">
<LC
Sources="@(_LicxFile)&quot;
LicenseTarget="$(TargetFileName)"
OutputDirectory="$(IntermediateOutputPath)" OutputLicense="$(IntermediateOutputPath)$(TargetFileName).licenses" ReferencedAssemblies="@(ReferencePath);@(ReferenceDependencyPaths)&quot;
ToolPath="$(LCToolPath)">
<Output TaskParameter="OutputLicense" ItemName="CompiledLicenseFile"/>
<Output TaskParameter="OutputLicense" ItemName="FileWrites"/>
</LC>
</Target>


When I add the RedGate parts to one of the existing license files I also get this error. When I remove the license file and the RedGate content, it gets compilable again.

Is there an other way to distribute and use the API? I am looking forward to any hints.

Susanne

Comments

  • Hi Susanne

    Can you let us know what is inside the licx file you created.

    This is most often the problem as the format has to be just right.

    Regards
    Dan
    Daniel Handley
    Red Gate Software Ltd
  • Hello!

    the content was:
    RedGate.SQLCompare.Engine.Database, RedGate.SQLCompare.Engine
    RedGate.SQLDataCompare.Engine.ComparisonSession, RedGate.SQLDataCompare.Engine

    followed by a blank line. I followed the instructions from the help file.

    Regards, Susanne
  • Hi

    This looks good.
    If you copied it from the help file it may be worth actually typing it out as this can resolve issues sometimes.

    Also can you check that the software has already been activated on you machine.

    Finally can you check to see why you are using lc from .net 2 rather than .net 1.1 from VS 2003.

    Dan
    Daniel Handley
    Red Gate Software Ltd
  • Hi Dan,

    I will try to type the words manually.

    The software is activated. I can use the UI-Program and the command line tools without license dialog appearing.

    What do you mean with "lc from .NET 2"? Yes, I use .NET 2 framework. Is this not supported yet?

    Regards
    Susanne
  • In your original message you have copied the message.

    Error 17 "LC.exe" ended with Code -1
    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets 1669 9 UptimeWinPresentation

    This shows that you are using .net 2. VS 2003 uses .Net 1.1 to use .Net 2 you should be developing in VS 2005.

    Dan
    Daniel Handley
    Red Gate Software Ltd
  • Oh, this was a mistake. I am using VS 2005 with .NET 2
  • Hello!

    I still have no solution for that problem. Does anyone else has this trouble with licensing?

    Ciao
    Susanne
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi Susanne,

    Reading this, my feeling is that the issue is somehow caused by multiple assemblies using the same licensing strategy. Does it work if you remove the other components and compile referencing only the SQL Toolkit assemblies?
  • Just wanted to let you know that I have the same issue. I am running the SQL Compare tutorial and each time I rebuild the project I am prompted to register the Toolkit.
    Running MS Visual Studio .NET 2003 and using the VB SQLCompareCodeSnippets Tutorial.
    Latest version of SQL Toolkit.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi,

    I think you've got a different issue, tc. If you get prompted to enter a serial number at every build, that's probably not critical. Every time you start a new project, you may need to reactivate because RedGate.Licensing.Helper can't find the licence file from the last time you'd activated. This could be because the .lic file created after activation is not in your assembly references path?

    Now if you deploy the licensed assembly and it asks for activation on the user's computer, then something didn't work right.

    Now Susanne can't even get to the bit where you enter a serial number as far as I can tell, because good old Microsoft lc.exe is throwing an error.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Susanne,

    If you're using VS2003 can you please check the properties on licenses.licx, make sure the build action is 'embedded resource'. *very important*!

    I think Dan may also have been on to something -- VS2003 may be calling the wrong version of lc.exe. What I know about embedded resources suggests that resources created by .NET 1.1 are not compatible with .NET 2.0 (I see this sometimes in Packager), so maybe the issue is that lc.exe simply doesn't understand the automatically-generated resource created by VS2003.

    Can you please check this registry value:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\sdkInstallRootv1.1
    This should point out the location of lc.exe to VS2003 (append 'Bin' to that path). Maybe this is set to an invalid file path and/or lc.exe is missing or damaged.
  • Hi Brian,

    I am using Framework 2. Here is my registry entry:
    sdkInstallRootv2.0 = C:\Programme\Microsoft Visual Studio 8\SDK\v2.0The directory is existing and contains bin folder and lc.exe

    I also checked the properties of the license file. It i embedded resource.

    Regards
    Susanne
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi Susanne,

    Just to confirm: you are using VS2005 and .NET Framework 2.0? At the start of the thread it looked like VS2003 was trying to load lc.exe from .NET 2.0's folder.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    If the above is true, can you try going into Visual Studio 2003 setup and installing or reinstalling the 'SDK'? Maybe the unavailability of the 2003 version of lc.exe is the issue.
  • Hi Brian,
    Just to confirm: you are using VS2005 and .NET Framework 2.0? At the start of the thread it looked like VS2003 was trying to load lc.exe from .NET 2.0's folder.

    I checked my system. I have installed .Net 2 and VS 2005. No SKD 1 and no VS 2003.

    So there should be no problem with wrong lc.exe. There is only one lc.exe on my system.

    Kind regards
    Susanne
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    I'd recommend contacting support to resolve this using remote desktop tools. I've pretty much run out of ideas. Can you give us a call at 866 733 4283 or send us an email to support@red-gate.com with your contact details? Unfortunately I haven't been able to find you in our contacts database by name or email. You may want to include your serial number in any correspondence to speed things up.
  • The SQL Compare API
    Distributing Your Applications
    Glossary Item Box

    To distribute your applications:

    Ensure you have a valid SQL Toolkit serial number.
    If you do not have a valid, activated serial number, the applications you distribute will display a trial expiry dialog box and will stop working when your trial expires.

    Add a licenses.licx file to your C# or Visual Basic .NET project in Visual Studio.
    If a licenses.licx file does not exist in your Visual Studio 2005 project, you must create one with the following entries in it:

    RedGate.SQLCompare.Engine.Database, RedGate.SQLCompare.Engine

    Compile your application.
    If you have a valid serial number and a valid licenses.licx file, your executable file will run SQL Compare without displaying the trial expiry dialog box.

    Distribute your application.
    You must distribute the following files with your application:

    RedGate.SQL.Shared.dll

    RedGate.SQLCompare.Engine.dll

    RedGate.SQLCompare.Rewriter.dll

    RedGate.SQLCompare.ASTParser.dll

    Note that you are not permitted to distribute any other Red Gate files. In particular, you must not distribute any .lic files.
Sign In or Register to comment.