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


// Make a new AppDomain in the current process



Download 21,46 Mb.
Pdf ko'rish
bet1104/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   1100   1101   1102   1103   1104   1105   1106   1107   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition

// Make a new AppDomain in the current process.

AppDomain anotherAD = AppDomain.CreateDomain("SecondAppDomain");

PrintAllAssembliesInAppDomain(anotherAD);

Console.ReadLine();

}

Now, if you run the application again (see Figure 17-7), notice that the System.Windows.Forms.



dll, System.Drawing.dll, and System.dll assemblies are only loaded within the default application

domain. This may seem counterintuitive if you have a background in traditional Win32 (as you

might suspect, both application domains have access to the same assembly set). Recall, however,

that an assembly loads into an application domain, not directly into the process itself.

C H A P T E R   1 7  

P R O C E S S E S, A P P D O M A I N S, A N D   O B J E C T C O N T E X T S



574

8849CH17.qxd  10/9/07  4:29 PM  Page 574




Figure 17-7.

A single process with two application domains

Next, notice how the SecondAppDomain application domain automatically contains its own

copy of mscorlib.dll, as this key assembly is automatically loaded by the CLR for each and every

application domain. This begs the question, “How can I programmatically load an assembly into

an application domain?” Answer: with the AppDomain.Load() method (or, alternatively, AppDomain.

ExecuteAssembly() to load and execute the Main() method of an *.exe assembly).

Assuming you have copied CarLibrary.dll to the application directory of AppDomainManipulator.

exe, you may load CarLibrary.dll into the SecondAppDomain application domain as follows:

static void Main(string[] args)

{

...




Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   1100   1101   1102   1103   1104   1105   1106   1107   ...   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