Tuesday, September 11, 2007

Installing an Assembly in the Global Assembly Cache.

The steps are follows:-
1)Create a Class Library project in VS.net and name it as GACShow.
2)Generating a public name:
To generate this cryptographic key pair use the SN tool.This tool is located in the \bin subdirectory where the .net framework Software Development Kit(SDK) is installed.
The command-line statement takes the following :
form:sn -k "[DriveLetter]:\[DirectoryToPlaceKey]\[KeyName].snk"
3)Create a directory named GACKey in the C: drive so that you can easily locate and access the key from the command prompt.
Note: For most users, the .NET tools are located in C:\Program Files\Microsoft.NET\FrameworkSDK\Bin. Before you type the following SN command, you may want to copy this similar path on your computer to the .NET bin directory. Type cd from the command prompt, right-click to paste the path, and then press ENTER to quickly change to the directory where the SN Tool is located.
Type the following:
sn -k "C:\GACKey\GACkey.snk"
4)Placing the KeyFile into the Assembly:
A key is generated, but it is not yet associated with the assembly of the project. To create this association, double-click the AssemblyInfo.cs file in Visual Studio .NET Solution Explorer. This file has the list of assembly attributes that are included by default when a project is created in Visual Studio .NET. Modify the AssemblyKeyFile assembly attribute in the code as follows:
[assembly: AssemblyKeyFile("C:\\GACKey\\GACKey.snk")]
5)Compile the project by clicking CTRL+SHIFT+B. You do not have to have any additional code to install a .dll file in the GAC.
6)Placing the Assemby into the GAC:
There are two ways by which you can place the assembly in the GAC-
i)You can install the .dll file by using the Gacutil Tool. If you use the Gacutil Tool, you can use the following command:
c:\>gacutil -I "[DriveLetter]:\[PathToBinDirectoryInVSProject]\projname.dll" It means that place the .dll that you can find in the bin subdirectory of your project.
ii)If you want to drag the file, use Microsoft Windows Explorer. Open two instances of Windows Explorer. In one instance, find the location of the .dll file output for your console project.
In the other instance, find c:\[SystemRoot]\Assembly. Drag your .dll file to the Assembly folder- c:\WINDOWS\Assembly

2 comments:

Anonymous said...

Oi, achei seu blog pelo google está bem interessante gostei desse post. Gostaria de falar sobre o CresceNet. O CresceNet é um provedor de internet discada que remunera seus usuários pelo tempo conectado. Exatamente isso que você leu, estão pagando para você conectar. O provedor paga 20 centavos por hora de conexão discada com ligação local para mais de 2100 cidades do Brasil. O CresceNet tem um acelerador de conexão, que deixa sua conexão até 10 vezes mais rápida. Quem utiliza banda larga pode lucrar também, basta se cadastrar no CresceNet e quando for dormir conectar por discada, é possível pagar a ADSL só com o dinheiro da discada. Nos horários de minuto único o gasto com telefone é mínimo e a remuneração do CresceNet generosa. Se você quiser linkar o Cresce.Net(www.provedorcrescenet.com) no seu blog eu ficaria agradecido, até mais e sucesso. (If he will be possible add the CresceNet(www.provedorcrescenet.com) in your blogroll I thankful, bye friend).

Anonymous said...

Oi, achei seu blog pelo google está bem interessante gostei desse post. Gostaria de falar sobre o CresceNet. O CresceNet é um provedor de internet discada que remunera seus usuários pelo tempo conectado. Exatamente isso que você leu, estão pagando para você conectar. O provedor paga 20 centavos por hora de conexão discada com ligação local para mais de 2100 cidades do Brasil. O CresceNet tem um acelerador de conexão, que deixa sua conexão até 10 vezes mais rápida. Quem utiliza banda larga pode lucrar também, basta se cadastrar no CresceNet e quando for dormir conectar por discada, é possível pagar a ADSL só com o dinheiro da discada. Nos horários de minuto único o gasto com telefone é mínimo e a remuneração do CresceNet generosa. Se você quiser linkar o Cresce.Net(www.provedorcrescenet.com) no seu blog eu ficaria agradecido, até mais e sucesso. (If he will be possible add the CresceNet(www.provedorcrescenet.com) in your blogroll I thankful, bye friend).