Hi Everyone
 
I'm getting the following error while I try to execute the following target from the build script:
 
Target:
-------------------------------------------------------------------------------------------------
<?xml version="1.0"?>
<project name="TestKey" default="TestKey">
 <property name="key.pair" value="e:\temp\math\new" />
 
 <target name="TestKey" description="The following command creates a new, random key pair">
   <!-- Execute sn -q -k ${key.pair}.snk -->
   <exec program="E:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\sn">
     <arg value="-k ${key.pair}.snk" />
   </exec>
 </target>
</project>
-------------------------------------------------------------------------------------------------
 
 
Output of the above build:
-------------------------------------------------------------------------------------------------
C:\>nant -buildfile:e:\temp\math\key.build
NAnt 0.85 (Build 0.85.1793.0; rc1; 11/28/2004)
Copyright (C) 2001-2004 Gerry Shaw
http://nant.sourceforge.net
 
Buildfile: file:///e:/temp/math/key.build
Target(s) specified: TestKey
 

TestKey:
 
     [exec]
     [exec] Microsoft (R) .NET Framework Strong Name Utility  Version 1.1.4322.5
73
     [exec] Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
     [exec]
     [exec] Invalid option -k e:\temp\math\new.snk
     [exec] Usage: SN [-q(uiet)] <option> [<parameters>]
     [exec]  Options:
     [exec]   -c [<csp>]
     [exec]     Set/reset the name of the CSP to use for MSCORSN operations.
     [exec]   -d <container>
     [exec]     Delete key container named <container>.
     [exec]   -D <assembly1> <assembly2>
     [exec]     Verify <assembly1> and <assembly2> differ only by signature.
     [exec]   -e <assembly> <outfile>
     [exec]     Extract public key from <assembly> into <outfile>.
     [exec]   -i <infile> <container>
     [exec]     Install key pair from <infile> into a key container named <conta
iner>.
     [exec]   -k <outfile>
     [exec]     Generate a new key pair and write it into <outfile>.
     [exec]   -m [y|n]
     [exec]     Enable (y), disable (n) or check (no parameter) whether key cont
ainers
     [exec]     are machine specific (rather than user specific).
     [exec]   -o <infile> [<outfile>]
     [exec]     Convert public key in <infile> to text file <outfile> with comma
 separated
     [exec]     list of decimal byte values.
     [exec]     If <outfile> is omitted, text is copied to clipboard instead.
     [exec]   -p <infile> <outfile>
     [exec]     Extract public key from key pair in <infile> and export to <outf
ile>.
     [exec]   -pc <container> <outfile>
     [exec]     Extract public key from key pair in <container> and export to <o
utfile>.
     [exec]   -q
     [exec]     Quiet mode. This option must be first on the command line and wi
ll suppress
     [exec]     any output other than error messages.
     [exec]   -R <assembly> <infile>
     [exec]     Re-sign signed or partially signed assembly with the key pair in
 <infile>.
     [exec]   -Rc <assembly> <container>
     [exec]     Re-sign signed or partially signed assembly with the key pair in
 the key
     [exec]     container named <container>.
     [exec]   -t[p] <infile>
     [exec]     Display token for public key in <infile> (together with the publ
ic key
     [exec]     itself if -tp is used).
     [exec]   -T[p] <assembly>
     [exec]     Display token for public key of <assembly> (together with the pu
blic key
     [exec]     itself if -Tp is used).
     [exec]   -v[f] <assembly>
     [exec]     Verify <assembly> for strong name signature self consistency. If
 -vf is
     [exec]     specified, force verification even if disabled in the registry.
     [exec]   -Vl
     [exec]     List current settings for strong name verification on this machi
ne.
     [exec]   -Vr <assembly> [<userlist>]
     [exec]     Register <assembly> for verification skipping (with an optional,
 comma
     [exec]     separated list of usernames for which this will take effect). <a
ssembly>
     [exec]     can be specified as * to indicate all assemblies or *,<public ke
y token> to
     [exec]     indicate that all assemblies with the given public key token. Pu
blic key
     [exec]     tokens should be specified as a string of hex digits.
     [exec]   -Vu <assembly>
     [exec]     Unregister <assembly> for verification skipping. The same rules
for
     [exec]     <assembly> naming are followed as for -Vr.
     [exec]   -Vx
     [exec]     Remove all verification skipping entries.
     [exec]   -?
     [exec]   -h
     [exec]     Displays this help text.
 
BUILD FAILED
 
e:\temp\math\key.build(7,5):
External Program Failed: E:\Program Files\Microsoft Visual Studio .NET 2003\SDK\
v1.1\Bin\sn (return code was 1)
 
Total time: 0.1 seconds.
 

C:\>nant -buildfile:e:\temp\math\key.build
NAnt 0.85 (Build 0.85.1793.0; rc1; 11/28/2004)
Copyright (C) 2001-2004 Gerry Shaw
http://nant.sourceforge.net
 
Buildfile: file:///e:/temp/math/key.build
Target(s) specified: TestKey
 

TestKey:
 
     [exec]
     [exec] Microsoft (R) .NET Framework Strong Name Utility  Version 1.1.4322.5
73
     [exec] Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
     [exec]
     [exec] Invalid option -k e:\temp\math\new.snk
     [exec] Usage: SN [-q(uiet)] <option> [<parameters>]
     [exec]  Options:
     [exec]   -c [<csp>]
     [exec]     Set/reset the name of the CSP to use for MSCORSN operations.
     [exec]   -d <container>
     [exec]     Delete key container named <container>.
     [exec]   -D <assembly1> <assembly2>
     [exec]     Verify <assembly1> and <assembly2> differ only by signature.
     [exec]   -e <assembly> <outfile>
     [exec]     Extract public key from <assembly> into <outfile>.
     [exec]   -i <infile> <container>
     [exec]     Install key pair from <infile> into a key container named <conta
iner>.
     [exec]   -k <outfile>
     [exec]     Generate a new key pair and write it into <outfile>.
     [exec]   -m [y|n]
     [exec]     Enable (y), disable (n) or check (no parameter) whether key cont
ainers
     [exec]     are machine specific (rather than user specific).
     [exec]   -o <infile> [<outfile>]
     [exec]     Convert public key in <infile> to text file <outfile> with comma
 separated
     [exec]     list of decimal byte values.
     [exec]     If <outfile> is omitted, text is copied to clipboard instead.
     [exec]   -p <infile> <outfile>
     [exec]     Extract public key from key pair in <infile> and export to <outf
ile>.
     [exec]   -pc <container> <outfile>
     [exec]     Extract public key from key pair in <container> and export to <o
utfile>.
     [exec]   -q
     [exec]     Quiet mode. This option must be first on the command line and wi
ll suppress
     [exec]     any output other than error messages.
     [exec]   -R <assembly> <infile>
     [exec]     Re-sign signed or partially signed assembly with the key pair in
 <infile>.
     [exec]   -Rc <assembly> <container>
     [exec]     Re-sign signed or partially signed assembly with the key pair in
 the key
     [exec]     container named <container>.
     [exec]   -t[p] <infile>
     [exec]     Display token for public key in <infile> (together with the publ
ic key
     [exec]     itself if -tp is used).
     [exec]   -T[p] <assembly>
     [exec]     Display token for public key of <assembly> (together with the pu
blic key
     [exec]     itself if -Tp is used).
     [exec]   -v[f] <assembly>
     [exec]     Verify <assembly> for strong name signature self consistency. If
 -vf is
     [exec]     specified, force verification even if disabled in the registry.
     [exec]   -Vl
     [exec]     List current settings for strong name verification on this machi
ne.
     [exec]   -Vr <assembly> [<userlist>]
     [exec]     Register <assembly> for verification skipping (with an optional,
 comma
     [exec]     separated list of usernames for which this will take effect). <a
ssembly>
     [exec]     can be specified as * to indicate all assemblies or *,<public ke
y token> to
     [exec]     indicate that all assemblies with the given public key token. Pu
blic key
     [exec]     tokens should be specified as a string of hex digits.
     [exec]   -Vu <assembly>
     [exec]     Unregister <assembly> for verification skipping. The same rules
for
     [exec]     <assembly> naming are followed as for -Vr.
     [exec]   -Vx
     [exec]     Remove all verification skipping entries.
     [exec]   -?
     [exec]   -h
     [exec]     Displays this help text.
 
BUILD FAILED
 
e:\temp\math\key.build(7,5):
External Program Failed: E:\Program Files\Microsoft Visual Studio .NET 2003\SDK\
v1.1\Bin\sn (return code was 1)
 
Total time: 0.3 seconds.
----------------------------------------------------------------------------------------------------------------------------
 
 
Any pointers to workaround the same.
 
Regards
Shelly

 
 

Reply via email to