Bugs item #1497556, was opened at 2006-05-30 15:44
Message generated for change (Comment added) made by aszalajs
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1497556&group_id=31650

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: antony gorman (neh)
Assigned to: Nobody/Anonymous (nobody)
Summary: Compilation error - References for scripts

Initial Comment:
if you call a script block twice when that block has a 
reference to another dll - the second times its called 
it will fail with conmpilation problem 

i.e.

Build Error: NAnt.Core.BuildException
Compilation failed: error CS1703: An assembly with the 
same identity 'System.Data, Version=2.0.0.0, 
Culture=neutral, PublicKeyToken=b77a5c561934e089' has 
already been imported. Try removing one of the 
duplicate references. //-------------------------------
----------------------------------------------- 

Having checked the source code briefly it appears this 
is as there are two checks to referenced assemblies - 
first check the appdomain for loaded assmeblies adding 
each as a reference, then check the references element 
from the task definition - if you follow this the 
first time it compiles fine, then runs (and so loads 
the referenced assembly) then the second time will add 
it from loaded assemblies then again from the 
references tag and so the compiler thinks its got the 
reference twice and falls over.

cheers



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

Comment By: Alain Szalajski (aszalajs)
Date: 2010-01-05 09:40

Message:
I have got the same problem. 

What is the workround ? 

My configuration : 
- ant 0.86
- PRN_LIB/Framework/2.0 and PRN_LIB/Framework/3.0 are personnal
directories where .NET librairies have been copied from .NET install
directory
- nant build file like this : 

                    <references>
                                <lib>
                                        <include 
name="../PRN_LIB/Framework/2.0" />
                                        <include 
name="../PRN_LIB/Framework/3.0" />
                                </lib>
                                <include name="../PRN_LIB/*.dll" />
                                <include name="System.dll" />
                                <include name="System.Data.dll" />
                                <include name="System.XML.dll" />
                        </references>

error message : 

     [exec]     [mkdir] Creating directory
'D:\_MAVPCC\projets\PRN_COMMUN\target'.
     [exec]       [csc] Compiling 22 files to
'D:\_MAVPCC\projets\PRN_COMMUN\target\PRN_COMMUN.dll'.
     [exec]       [csc]
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll: error CS1703: Un
assembly avec la même identité 'System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' a déjà été importé. Essayez de
supprimer l'une des références en double.
     [exec]       [csc]
d:\_MAVPCC\projets\PRN_LIB\Framework\2.0\System.dll: (Emplacement du
symbole par rapport à l'erreur précédente)
     [exec]       [csc]
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll: error
CS1703: Un assembly avec la même identité 'System.Data, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' a déjà été importé.
Essayez de supprimer l'une des références en double.
     [exec]       [csc]
d:\_MAVPCC\projets\PRN_LIB\Framework\2.0\System.Data.dll: (Emplacement du
symbole par rapport à l'erreur précédente)
     [exec]       [csc]
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll: error CS1703:
Un assembly avec la même identité 'System.Xml, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' a déjà été importé.
Essayez de supprimer l'une des références en double.
     [exec]       [csc]
d:\_MAVPCC\projets\PRN_LIB\Framework\2.0\System.XML.dll: (Emplacement du
symbole par rapport à l'erreur précédente)
     [exec]
     [exec] BUILD FAILED
     [exec]


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

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

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to