PC Review


Reply
Thread Tools Rate Thread

Re: strong name using al.exe and csc.exe

 
 
Bennie Haelen
Guest
Posts: n/a
 
      1st Sep 2005
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.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strong Name Michael Voss Microsoft C# .NET 3 27th Apr 2007 11:51 AM
How to Strong name a dll =?Utf-8?B?TWFyY28=?= Microsoft Dot NET 1 22nd Jul 2005 07:59 AM
Re: Strong Naming a Non-Strong Named assembly Joyjit Mukherjee Microsoft Dot NET Framework 0 24th Aug 2004 03:17 PM
strong naming an assembly that has non-strong named references? SStory Microsoft VB .NET 2 10th Jun 2004 07:41 PM
Re: There Were 100,000 Strong The Revd Terence Fformby-Smythe Printers 1 1st May 2004 04:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:40 PM.