This print for content only-size & color not accurate 7" X 9-1/4" / casebound / malloy



Download 21,46 Mb.
Pdf ko'rish
bet985/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   981   982   983   984   985   986   987   988   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition



Note

Strong names also provide a level of protection against potential evildoers tampering with your assem-

bly’s contents. Given this point, it is considered a .NET best practice to strongly name every assembly (including

*.exe


assemblies) regardless of whether it is deployed to the GAC.

C H A P T E R   1 5  



I N T R O D U C I N G   . N E T  A S S E M B L I E S



506

8849CH15.qxd  10/22/07  1:46 PM  Page 506




Strongly Naming CarLibrary.dll

Let’s walk through the process of assigning a strong name to the CarLibrary assembly created ear-

lier in this chapter. The first order of business is to generate the required key data using the sn.exe

utility. Although this tool has numerous command-line options, all you need to concern yourself

with for the moment is the -k flag, which instructs the tool to generate a new file containing the

public/private key information. Create a new folder on your C drive named MyTestKeyPair and

change to that directory using the Visual Studio 2008 command prompt. Next, issue the following

command to generate a file named MyTestKeyPair.snk:

sn -k MyTestKeyPair.snk

Now that you have your key data, you need to inform the C# compiler exactly where

MyTestKeyPair.snk is located. When you create any new C# project workspace using Visual Studio

2008, you will notice that one of your initial project files (located under the Properties node of Solu-

tion Explorer) is named AssemblyInfo.cs. This file contains a number of attributes that describe the

assembly itself. The [AssemblyKeyFile] assembly-level attribute can be used to inform the compiler

of the location of a valid *.snk file. Simply specify the path as a string parameter, for example:

[assembly: AssemblyKeyFile(@"C:\MyTestKeyPair\MyTestKeyPair.snk")]




Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   981   982   983   984   985   986   987   988   ...   1830




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish