LC.EXE Command Line Problem
HTI
Posts: 6
Compiling the LICX file in from VS.NET works fine now, however when attempting to build it in my NANT script (or from the command line) I get the following errors:
I have tried copied all of the appropriate RedGate dlls to the current directory, but that does not seem to work either.
What should the correct command line options be to LC.EXE?
C:\>lc /target:my.exe /complist:licenses.licx /v
Microsoft (R) .NET License Compiler
[Microsoft .Net Framework, Version 1.1.4322.573]
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
Processing complist 'licenses.licx'...
licenses.licx(1) : info LC0001 : Processing component entry 'RedGate.SQLCompare.Engine.Database'
licenses.licx(1) : error LC0003 : Unabled to resolve type 'RedGate.SQLCompare.Engine.Database'
licenses.licx(2) : info LC0001 : Processing component entry 'RedGate.SQLDataCompare.Engine.ComparisonSession'
licenses.licx(2) : error LC0003 : Unabled to resolve type 'RedGate.SQLDataCompare.Engine.ComparisonSession'
Creating Licenses file my.exe.licenses...
I have tried copied all of the appropriate RedGate dlls to the current directory, but that does not seem to work either.
What should the correct command line options be to LC.EXE?
Comments
The .NET component licensing can be tricky indeed. If it works in Visual Studio, but not in Lc.exe, maybe it will help if you give lc.exe more information in licenses.licx. Can you try adding the following to licenses.licx?
RedGate.SQLDataCompare.Engine.ComparisonSession, RedGate.SQLDataCompare.Engine, Version=3.3.9.14, Culture=neutral, PublicKeyToken=00240000048000009400000006020000002400005253413100040000010001008FC10F454406BF85568F958675567383EB344EF516BEC3937AAD9239B15EDF1EB663E2501CE211AB47FB6C26554697B487E8CDA6B2D662B42146417D62AA9C74C4719BC5910DB2659584ADC4F07F0687744B038085B76CC6336A7108738CCFD0AABE44760EC94C8DFD29009FC2DEF78455CE1920A2A5696D108734386CE04AD9
RedGate.SQLCompare.Engine.Database, RedGate.SQLCompare.Engine, Version=3.2.0.5, Culture=neutral, PublicKeyToken=00240000048000009400000006020000002400005253413100040000010001008FC10F454406BF85568F958675567383EB344EF516BEC3937AAD9239B15EDF1EB663E2501CE211AB47FB6C26554697B487E8CDA6B2D662B42146417D62AA9C74C4719BC5910DB2659584ADC4F07F0687744B038085B76CC6336A7108738CCFD0AABE44760EC94C8DFD29009FC2DEF78455CE1920A2A5696D108734386CE04AD9
Around 9 months ago now we updated our build system and began using NAnt to build our projects and I experienced exactly the problem you're having.
Basically whatever we did we could not get lc.exe to work. I even looked at lc.exe using Lutz Roeder's .NET Reflector, and from the code couldn't figure out how it possibly could work. In the end what I did was to quickly hack together an NAnt task to wrap devenv.exe and build our VS.NET projects. I had previously tried using the NAnt 'solution' task, as well as carrying out all the build steps manually, but to no avail.
This might not be what you're looking to do, however it will build VS.NET projects (you'll need to change the exe path for 2003 though, as it looks like the default is set to 2002 - really we should grab this value from the registry), and will compile the licenses in as you need it to. The problem of course is that way VS.NET builds projects is a complete black box so you've no control whatsoever, except that with 2003 you can of course specify pre- and post-build events.
Anyway, I hope this helps you out. I've pasted the code into my next message. Also, should you need a copy of the GNU LGPL you can find it in plaintext format at http://www.gnu.org/licenses/lgpl.txt.
Kind regards,
Principal Consultant
bartread.com Ltd
Principal Consultant
bartread.com Ltd
I believe that if your build process is running as the LocalSystem account, you may get this error for that reason. If that's the case, then the solution would be to run your automated build process as a named user, one that has a valid profile that can be loaded.
Hopefully this helps!