Hi:
This should work:
1. Create your source file (e.ge. testApp.cs)
2. Create your keypair:
sn -k keypair.snk
3. Compile your source file into a .NET Module:
csc /target:module testApp.cs
this will create a file called testApp.netmodule
4. Use the assembly linker to create the .exe:
al /target:exe /out:testApp.exe /main:MyNamespace.testapp.Main
/keyfile:keypair.snk testApp.netmodule
Notice here that you should use the correct fully qualified name for
your main method: <NameSpace>.<className>.<MethodName>
Hope this helps,
Bennie Haelen
Danny Cooper wrote:
> I'm very much a beginner with C# and the .NET Framework environment,
> and am writing and building C# programs using the command line CSC.EXE
> compiler. What I'm trying to do now is try out some of the evidence
> options and the security policy settings.
>
> Code Signing and using this via certificates and Publish evidence is
> working fine, but I'm a bit stumped by strong naming at the moment.
>
> I've created a key pair using sn.exe, and read that I sign with this
> to an assembly before it's built (so not to a completed .exe).
>
> This seems to be the way to go from what I've read:
> AL.EXE /out:testapp.exe testapp.netmodule /keyfile:keypair.snk
>
> So far I've been using /target:winexe in CSC.EXE, so don't have the
> module files AL.EXE wants. I tried changing the CSC.EXE command line
> to:
> CSC.EXE /target.module /reference:... testapp.cs
>
> This allowed AL.EXE to complete without error messages, but the
> resulting .EXE says it's not a valid Win32 executable.
>
> Can anyone point me in the right direction to getting a valid Win32
> executable that is strong named, using only the command line tools of
> the SDK?
>
>
> Danny.
>
|