Article
    C#
    ADO.Net
    .NET
    ASP.Net & Web Forms
    Custom Controls
    Web Development
    Exception Handling
    XML
    Database
    Security in .Net
    Testing
    Web Services
    Windows Services
    Windows Controls
    WCF
    AJAX
    WPF
    XAML
    Reporting
    Setup
    VB.Net
    LINQ
    JQuery
    SilverLight
    JavaScript
    HTML5
    Crystal Report
    Cloud Computing
    Share Point
    Visual C++
    MVC
    Android
    PHP
    Java
    HTML
    WordPress
    Joomla
    Products
    Drupal
    Windows Phone
    JSON
    LightSwitch
    iPhone/iPad
    Ruby on Rails
    IIS 7
    Windows 8
    CSS/CSS3
    Excel
    MS Access
    Shortcut Keys
    Visual SourceSafe
    Team Foundation Server
    APIs
Follow Us
Follow _MindStick_ on Twitter View MindStick Software's LinkedIn profile View MindStick Software's Facebook profile
Top Contributor
Advertisement
Advertise with Us
Mindstick
Article Article  Forum Forum  Blog Blog  Quiz Quiz  Beginner Beginner  Careers Careers  Contact Contact  Login Login  
Home | Product | Services | About Us | Interview | DeveloperSection | Submit an Article | Submit Blog

Home >> ASP.Net & Web Forms >> Strong name and gacutil command in .Net
Strong name and gacutil command in .Net
Strong name and gacutil command in .Net


by AVADHESH PATEL on 7/9/2012 9:23:58 PM

Views: 1957       Comments: 0

Strong name and gacutil command in .Net

Strong name:

Strong Name is similar to GUID (It is supposed to be unique in space and time). In COM components, Strong name is only needed when we need to deploy assembly in GAC. Strong names help GAC to differentiate between two versions. Strong names use public key cryptography (PKC) to ensure that no one can spoof it. PKC use public key and private key concept. Following are the step to generate a strong name and sign an assembly:

gacutil command:

The Global Assembly Cache tool allows you to view and manipulate the contents of the global assembly cache and download cache.

Gacutil.exe is considered to be a development tool. Because of this it is only contained in the .NET SDK but not in the regular redistributable. Visual Studio comes with the SDK, so all Visual Studio users have it installed.

Using strong name and gacutil command:

Step1: Go to “Microsoft Visual Studio 2010” >>Visual Studio Tool>> Visual Studio Command prompt. This wills popup the command prompt for you.

 

Strong name and gacutil command in .Net

Step2: After the command prompt run the strong tool from there

D:\>cd avi

D:\avi>sn –k key.snk

Here k: the key specifies that we want to generate the key.

key.snk: This file contains the key that is generated by the sn tool

 

Strong name and gacutil command in .Net

Note- Microsoft use symmetric algorithm, RSA2

Step3: Attached the key

using System;

using System.Reflection;

[assembly:AssemblyKeyFile("key.snk")]

public class show

{

    public string show_employee()

    {

        return "Hello...";

    }

}

 

Write above code on notepad and save it, where key.snk saved. Then make DLL like

Strong name and gacutil command in .Net

 

Step4: Mapped DLL in Assembly folder

Strong name and gacutil command in .Net

Step5:  Write code on notepad and make EXE file in different folder and access show.dll file

 

using System;

public class check

{

    public static void Main()

    {

       show s = new show();

       Console.WriteLine(s.show_employee());

    }

}

 

Strong name and gacutil command in .Net

 Step6:  execute check exe….

Strong name and gacutil command in .Net

Report Abuse Form
Reason:    
 

Title :
Comment :
Text ColorBackground Color
BoldItalicUnderline
LeftCenterRightJustify
Ordered ListBulleted List
IndentOutdent
Horizontal Rule
SubscriptSuperscript
HyperlinkImage
Design ModeDesign
View HtmlHtml
     
 
Latest Article by AVADHESH PATELRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Latest BlogsRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Top Viewed ArticlesRSS Feed
    
    
    
    
    
    
    
    
    
    
Top Viewed BlogsRSS Feed
    
    
    
    
    
    
    
    
    
    
Latest Interview QuestionsRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Total Online Users: 3301
Advertisement
MindStick SurveyManager
Advertise with Us
  
Copyright © 2013MindStick. All Rights Reserved.