Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / November 2006

Tip: Looking for answers? Try searching our database.

Strong Name required

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
saravana - 27 Nov 2006 05:25 GMT
Hi Jigar Mehta ,,

But I am using VS2003  .....

Where i have to mention the strong name( key value ) in assembly...
whether in assemblyinfo file or some other location ..
please provide write solution

Thanx in Advance
Jigar Mehta - 27 Nov 2006 13:03 GMT
Hello saravana,

I could find an MSDN article for this issue,

There are two ways to sign an assembly with a strong name:
•    Using the Assembly Linker (Al.exe) provided by the .NET Framework SDK.
•    Using assembly attributes to insert the strong name information in your
code. You can use either the AssemblyKeyFileAttribute or the AssemblyKeyNameAttribute,
depending on where the key file to be used is located.
You must have a cryptographic key pair to sign an assembly with a strong
name. For more information about creating a key pair, see Creating a Key
Pair.
To create and sign an assembly with a strong name using the Assembly Linker
•    At the command prompt, type the following command:
al /out:<assembly name> <module name> /keyfile:<file name>
In this command, assembly name is the name of the assembly to sign with a
strong name, module name is the name of the code module used to create the
assembly, and file name is the name of the container or file that contains
the key pair.
The following example signs the assembly MyAssembly.dll with a strong name
using the key file sgKey.snk.
al /out:MyAssembly.dll MyModule.netmodule /keyfile:sgKey.snk
To sign an assembly with a strong name using attributes
•    In a code module, add the AssemblyKeyFileAttribute or the AssemblyKeyNameAttribute,
specifying the name of the file or container that contains the key pair to
use when signing the assembly with a strong name.
The following code example uses the AssemblyKeyFileAttribute with a key file
called sgKey.snk.
[Visual Basic]
<Assembly:AssemblyKeyFileAttribute("sgKey.snk")>
[C#]
[assembly:AssemblyKeyFileAttribute(@"..\..\sgKey.snk")]
You can also delay sign an assembly when compiling. For more information,
see Delay Signing an Assembly.
When signing an assembly with a strong name, the Assembly Linker (Al.exe)
looks for the key file relative to the current directory and to the output
directory. When using command-line compilers, you can simply copy the key
to the current directory containing your code modules.

Let me know if you are still facing any problem.

=============
Regards,
Jigar Mehta

s> Hi Jigar Mehta ,,
s>
s> But I am using VS2003  .....
s>
s> Where i have to mention the strong name( key value ) in assembly...
s> whether in assemblyinfo file or some other location ..
s> please provide write solution
s> Thanx in Advance
s>

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.