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



Download 21,46 Mb.
Pdf ko'rish
bet976/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   972   973   974   975   976   977   978   979   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition



Note

Technically speaking, if a copy of the requested assembly cannot be found within the client’s application

directory, the CLR will also attempt to locate a client subdirectory with the exact same name as the assembly’s

friendly name (e.g., C:\MyClient\CarLibrary). If the requested assembly resides within this subdirectory, the CLR

will load the assembly into memory.

Configuring Private Assemblies

While it is possible to deploy a .NET application by simply copying all required assemblies to a sin-

gle folder on the user’s hard drive, you will most likely wish to define a number of subdirectories to

group related content. For example, assume you have an application directory named C:\MyApp

that contains CSharpCarClient.exe. Under this folder might be a subfolder named MyLibraries that

contains CarLibrary.dll.

Regardless of the intended relationship between these two directories, the CLR will 

not probe

the MyLibraries subdirectory unless you supply a configuration file. Configuration files contain var-

ious XML elements that allow you to influence the probing process. Configuration files must have

the same name as the launching application and take a *.config file extension, and they must be

deployed in the client’s application directory. Thus, if you wish to create a configuration file for

CSharpCarClient.exe, it must be named CSharpCarClient.exe.config and located (for this example)

under the C:\MyApp directory.

To illustrate the process, create a new directory on your C drive named MyApp using Windows

Explorer. Next, copy CSharpCarClient.exe and CarLibrary.dll to this new folder, and run the

program by double-clicking the executable. Your program should run successfully at this point

(remember, the assemblies are not registered!). Next, create a new subdirectory under C:\MyApp

named MyLibraries (see Figure 15-12), and move CarLibrary.dll to this location.

Try to run your client program again. Because the CLR could not locate an assembly named

“CarLibrary” directly within the application directory, you are presented with a rather nasty unhan-

dled FileNotFoundException exception.

To instruct the CLR to probe under the MyLibraries subdirectory, create a new configuration

file named CSharpCarClient.exe.config and save it in the same folder containing the

CSharpCarClient.exe application, which in this example would be C:\MyApp. Open this file

and enter the following content exactly as shown (be aware that XML is case sensitive!):






privatePath="MyLibraries"/>







C H A P T E R   1 5  




Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   972   973   974   975   976   977   978   979   ...   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