You're right - it is braindead.

It works if you only specify a single component to license, otherwise it fails. :(

What I didn't realize is that it will try over and over to re-populate its hashtable, failing. This causes the assembly resolution to fail. Unfortunately, there isn't any way to call lc.exe multiple times.

We should probably be documenting some of these quirks somewhere. I usually end up running into something that looks like a bug, but turns out to be "by design".

Matt.

Matthew Mastracci wrote:

Gert Driesen wrote:

Matthew,

The .NET 1.1 lc.exe indeed has a command line switch for specifying assembly
references, but it doesn't work. That's why we don't use it.



Actually, it does and I have proof. :) The only thing is that you can't specify assemblies that exist in the GAC (it gives you various errors from having the same key twice in a hashtable).


Basically, it works for me and I can see exactly why given the decompiled source.

Using Reflector:

handler1 = new ResolveEventHandler(LicenseCompiler.OnAssemblyResolve);
AppDomain.CurrentDomain.AssemblyResolve += handler1;
context1 = new DesigntimeLicenseContext();


and in OnAssemblyResolve

...

     foreach (string text2 in LicenseCompiler.assemblies)
     {
           assembly1 = Assembly.LoadFrom(text2);
           if (assembly1 == null)
           {
                 return null;
           }
           text3 = assembly1.GetName().Name;
           LicenseCompiler.assemHash.Add(text3, assembly1);
           if (text3 != text1)
           {
                 continue;
           }
           return assembly1;
     }

...

Gert

----- Original Message -----
From: "Matthew Mastracci" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 06, 2004 2:24 AM
Subject: [nant-commits] CVS: nant/src/NAnt.Console
NAnt.Console.exe.config,1.58,1.59




Update of /cvsroot/nant/nant/src/NAnt.Console
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8787

Modified Files:
NAnt.Console.exe.config
Log Message:
lc.exe supports assembly references

Index: NAnt.Console.exe.config
===================================================================
RCS file: /cvsroot/nant/nant/src/NAnt.Console/NAnt.Console.exe.config,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -d -r1.58 -r1.59
*** NAnt.Console.exe.config 5 Jul 2004 18:11:21 -0000 1.58
--- NAnt.Console.exe.config 6 Jul 2004 00:24:11 -0000 1.59
***************
*** 153,156 ****
--- 153,157 ----
<task name="license">
<attribute name="exename">lc</attribute>
+ <attribute

name="supportsassemblyreferences">true</attribute>


                         </task>
                         <task name="ilasm">



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
nant-commits mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-commits









-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to