Bugs item #999629, was opened at 2004-07-28 19:48
Message generated for change (Comment added) made by drieseng
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=999629&group_id=31650

Category: Tasks
>Group: cvs
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Tom Cabanski (tcabanski)
>Assigned to: Gert Driesen (drieseng)
Summary: Solution task cannot build project with delay signed ref

Initial Comment:
I have a project that contains a number of assemblies 
that get strongly named (signed) for distribution.  On 
development boxes we build using delayed signing and 
generally have strong name verification off for the 
various assemblies. 

When we test releases, we turn on strong name 
validation and sign the assemblies.  After testing is 
complete, we switch back to verification off and delay 
signing.

The latest versions of NAnt have a problem with partially 
signed assemblies.  In the case where verification is on, 
we cannot build because the referenced dlls are partially 
signed; nant complains that it cannot load the dll during 
the build process because the dll is not strongly named.

This leads to an interesting problem: the dlls have to 
exist before verification can be tuned off.  In the 
situation where dll a references b dll which references c 
dll, we have to build and let it fail because of 
verification on a, turn verification off for a, build and let 
it fail because of b, turn off verification on b and so on.  
This does not occur in VS.NET.

The problem is caused by 
NAnt.VSNet.GetAllReferencedModules where the 
following line of code appears:

 
_refResolver.AppendReferencedModulesLocatedInGivenDir
ectory(moduleDirectory, referenceToResolve, ref 
allReferences, ref unresolvedReferences);

This method uses Assembly.LoadFromFile to load a dll 
and find out what it references.  Of course, if the 
loaded dll is partially signed and verification is on, this 
fails.

Why is this method required?  We comment it out and 
our solution still works.  I would guess this is needed 
when building without a solution in case you forgot to 
specify the refrences.  The problem is it completely 
screws things up when using partially signed assemblies.

The bottom line is this: If NAnt needs to read the 
assembly to figure out the references, it needs to 
somehow skip verification on the assembly.  At the very 
least, it needs to open the assembly and look for 
references only if not using the solution task.  I'm not 
really sure how to fix this myself and that is why I am 
submitting a bug. 


----------------------------------------------------------------------

>Comment By: Gert Driesen (drieseng)
Date: 2004-07-30 13:32

Message:
Logged In: YES 
user_id=707851

For now, I've changed the solution task to no longer fail when 
an assembly for which referenced modules need to be 
obtained fails to load.

----------------------------------------------------------------------

Comment By: Tom Cabanski (tcabanski)
Date: 2004-07-29 18:28

Message:
Logged In: YES 
user_id=1088520

I have attached a small sample project.

----------------------------------------------------------------------

Comment By: Erv Walter (erv)
Date: 2004-07-28 20:35

Message:
Logged In: YES 
user_id=435624

Sounds like a fix will be possible, but I wanted to chime in 
with a possible workaround in the short term you might like.  
We use a similar process, but we disable verification on the 
development workstations using the public key instead of 
doing it for just a single assembly.  This means that we don't 
have to first have the assembly in order to disable the 
verification.  We use:

sn -Vr *,<public key token>

----------------------------------------------------------------------

Comment By: Gert Driesen (drieseng)
Date: 2004-07-28 20:24

Message:
Logged In: YES 
user_id=707851

Tom,

If you can create a small repro for this issue (containing the 
minimum set of files, but with both a small buildfile and a 
solution file), I'll make sure its fixed before the next release.

Thanks !

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=999629&group_id=31650


-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to