Rosy,
 
When using .NET 1.1, you specifiy the path to the key using the <vbc> task
since the .NET 1.1 VB compiler does not support this.
 
You need to ensure that the key is at the expected path relative to the
output directory. In your case, the Constants.snk file must be one level
below ${dist.dir} since the AssemblyKeyFile attribute has the value
"..\..\Constants.snk".  Just copy the key file to where the compiler expects
it.
 
This is not a NAnt limitation. You'll have the same problem in VS 2002/2003
if you change the output directory.
 
Note: your <delay-sign> task will also not work, since you specify a vb
source file as key file. Not sure what you're trying to do here. Are you
actually delay signing or not ?
 
Gert
  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Rosy Malhotra
Sent: vrijdag 4 mei 2007 8:49
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] strong name generation with nant using VBC task



Hi,

 

I want to generate strong name using VBC task. If I am using Solution
approach then it is generating the strong name automatically. But when we
are using VBC task then it is giving errors. O am using keyfile approach and
delay sign approach. Both are not working. My project already contains .snk
file and in assemblyinfo.vb file there is a entry for .snk file. But I am
getting the following errors. Please tell how I can sign my assembly with
already present .snk file 

 

Constants.compile:

 

     [echo] Compilation of Constants Source_Code

      [vbc] Compiling 20 files to
'D:\Birlasoft\DotNet\REIOS\dist\Constants.dll'.

      [vbc] The compiler for Microsoft .NET Framework 1.1 does not support
the /keycontainer option.

      [vbc] The compiler for Microsoft .NET Framework 1.1 does not support
the /keyfile option.

      [vbc] vbc : error BC30140: Error creating assembly manifest: Error
reading key file '..\..\Constants.snk' -- The system cannot find the file
specified.  

 

<target name="Constants.compile" depends="ActiveReportsDlls.copy"
description="Compilation of Constants Source_Code" >

<vbc target="library" output="${dist.dir}\Constants.dll"
keycontainer="${root.dir}\Source_Code\Constants\AssemblyInfo.vb"
keyfile="${root.dir}\Source_Code\Constants\Constants.snk">

                   <imports>

                        <import namespace = "Microsoft.VisualBasic" />

                        <import namespace = "System"/>

                        <import namespace = "System.Collections"/>

                        <import namespace = "System.Data"/>

                        <import namespace = "System.Diagnostics"/>

                  </imports>

                  <sources basedir="${root.dir}\Source_Code\Constants"> 

                        <include name="*.vb" />

                  </sources>

                  <references>

                        <include name = "System.dll"/>

                        <include name = "System.Data.dll" />

                        <include name = "System.Web.dll" />

                        <include name = "System.Web.Services.dll" />

                        <include name = "System.XML.dll" />

                        <include name = "System.EnterpriseServices.dll" />


                  </references>

            </vbc>

 

            <delay-sign
keyfile="${root.dir}\Source_Code\Constants\AssemblyInfo.vb" verbose="false">

                  <targets>

                    <include name="${dist.dir}\Constants.dll" />

                 </targets>

            </delay-sign>

            <echo message="${task.seperator}" /> 

      </target>

 

Thanks and Regards,

Rosy Malhotra

****************************************************************************
****************************************************************************
*************
"This message and any attachments are solely for the intended recipient and
may contain confidential or privileged information. If you are not the
intended recipient,any disclosure,copying, use, or distribution of the
information included in this message and any attachments is 
prohibited. If you have received this communication in error, please notify
us by reply e-mail and immediately and permanently delete this message and
any attachments. Thank you."
****************************************************************************
****************************************************************************
*************
        
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to