Title: Assemblies and Deployment in 'NET Framework
1(No Transcript)
2Assemblies and Deployment
???????????? ?? .NET Framework
http//www.nakov.com/dotnet-project/
?????? ???????
???-????? www.gis-sofia.bg Microsoft Student
Consultant www.fmi.uni-sofia.bg/microsoft/
3?????????? ??????
- ?????? ???????? ?? .NET Framework ? CLR (Common
Language Runtime) - ?????? ???????? ?? ?????? ??????? ?? ?????? ?
.NET (Common Type System - CTS) - ???????? ?? ????? C
- ????????? ?? ????????????? ?? .NET Framework SDK
4??????????
- ????? ? ????????
- ???? ???????
- ???????? ?? ???????
- ????????????? ?? ???????
- ???????? ?? ?????? ? ????????
- ????? ????????? ?? ???????
- Global Assembly Cache (GAC)
- ??????
- ??????? ?? ????????? (probing)
- ??????????????? ???????
5????? ? ????????
- ???? ?? ??????? ?????????
- ????????? ?? ??????
- ?????????
- ??????? ? ???????
- ???? ?? ????????? ?? ?????? ?? ??????? ????????
- ????? ?? ???????
- ??????? ??????? ?? ????????? ?????????? ?????????
- ??????? ????????, ?????????, ???????? ? ????????
?????????????? ??????
6????? ? ????????
- ?????????? ? ???????? ( Dll Hell ) ? .NET ??
?????? ? ???????? ?? ?????? ?? ???? ??????? - ???? ???????? ????? ?? ????????
- ??????? ???????? ?????? ?? ???? ? ???? ???????
????? ?? ??????????? ? ?? ?? ?????????
???????????? - ??????? ???????? ? ???????? ???????????
- ???-??????? deployment ??????? ? CLR
7???? ???????
- ??????? ??? ?? ??????????
- ????? ?? ??????? ? Portable Executable (PE) ????
(DLL, EXE) - ?????? ?? ??? ?????? ????? (entry point) -
DllMain, WinMain ??? Main - ??????? security boundary
- Permissions ?? ???????? ?? ? ????? ?? ????
??????? - ??????? type boundary
- ???????? ?? ???? ??????? ? ??????? ?? ???????? ??
????????, ????? ???????
8???? ???????
- ??????? reference scope boundary
- ???????? ? ????????? ????? ?? ????? private ??
???? ??????? ??? ?? ?? ?????? ????? ????????? - ??????? version boundary
- ?????? ?????? ? ??????? ?????? ???????? ?? ????
???? ???? - ? ??????? ?? ?????????
- ???? ?? ????????? ????????? (shared assembly)
- ??????? deployment unit
9???????? ?? ???????
- ????????? ???????? ?????????
- ??????????? ????????
- ?????????????
- ??? ?????? ??????? ?????????? (????)
- ?????? ?? ????????? ? ?????? ??????
- ?????????? ?????????
- ????????? ?? ????? ?? ??????, ?? ?? ??????
- ???????????? ?????? ? ???????
- ????????? ????? ?? ??????
10????????????? ?? ???????
- ??? ?? ?????????
- ?????????? ???
- ??????
- ??????? 4 ??????????????? ????????? ? ?????
- Major.Minor.Build.Revision ( ????.
2.0.1765.2 ) - ???????? ?? ?? CLR ??? version policy
- ???????? ?? ?????????
- ?????????? ???? ?? ??????????? (?????????????) ??
????????? - ??????? (????. en-US)
- RFC1766 ??? ??????? locale-a ?? ?????????
11???????????? 1
12???????? ?? ?????? ? ????????
- ????????, ????? ??????? ?????????
assembly AssemblyTitle("") assembly
AssemblyDescription("") assembly
AssemblyConfiguration("") assembly
AssemblyCompany("") assembly
AssemblyProduct("") assembly
AssemblyCopyright("") assembly
AssemblyTrademark("") assembly
AssemblyCulture("") assembly
AssemblyVersion("1.0.") assembly
AssemblyDelaySign(false) assembly
AssemblyKeyFile("") assembly
AssemblyKeyName("")
13????? ????????? ?? ???????
- ????? ?? ????????? ?? ???????? ????????????? ??
???? ??????? - ???
- ??????
- ???????
- ??? ?? ????????? ???? (public key token)
- ??????
- "myDll, Version1.0.0.1,Cultureneutral,
PublicKeyToken 9b35aa32c18d4fb1" - ???? ????? ??????????? ????????? ????? ?? ??
?????????? ? GAC
14???????????? 2
- ????????? ?? ????? ????????? ???????
15Global Assembly Cache (GAC)
- ??? ?????????, ? ????? ?? ?????????? ?????????
????????? (shared assemblies) - ????? ?? ?? ????????? ?? ?????? ??????????
- ???????? ? ? GAC ?? ??? ??? ???????? ?????? ??
???? ??????? - ?????? ?? ?????????????? ?? GAC
- Gacutil
- Windows Shell Extension ( Windows Explorer )
- .NET Configuration Management Console
16???????????? 3
- ?????? ? GAC (gacutil, shellextension)
17??????
- ???? ??????? ???? ?? ?? ?????? ?? ??????? ?????
- ????? ???? ?? ??? ?? ?????? ?????
- ???? ?? ??? ??????? ????????? ?? ?????????
- ???????? ?? ???????? ???? ??? ???????????? ??
?????? ?? ??? - ?????? ???? ?? ?? ? ???????? ???????
- jpg, xls, mdb
- VS.NET ?? ???? ?? ????????? ???? ??????? ?
???????? ??????
18??????
namespace FrequentlyUsedTypes public class
AFrequentlyUsedType
RUT.cs
namespace RarelyUsedTypes public class
ARarelyUsedType
19??????
- RUT.netmodule MyLibrary.dll
20???????????? 4
- ????????? ?? ???????????? ???????
21??????
- RUT.netmodule MyLibrary.dll
FUT.netmodule
22???????????? 5
- ????????? ?? ???????????? ???????
23??????? ?? ???????
- ??????, ? ????? ?????? ???????
- ??? ????????? ?? ?????? ????? ????????? ???????
(Late Binding) - ??? ?????????? ?????????? ????? ?????????
- ??? ????????? ?? ????? ????????? ??????? ?? GAC
- ??? ????????? ?? ?????? ????? ????????? ???????
- ???????? ?? ??????? ?? ?????? Probing
24??????? ?? ????????? (probing)
- ??? ?? ??????? ?? ???????, CLR ?? ?? ????? ??
???????? ????? - ????????? ? ??????????? ???????
- ???????? ?????????? ?? ????????????
- ???????????? ? ????? ?? ????????? (AsmbName)
- ???????? ?????? - ?????? ?? ??????? ???????? ?
???????????????? ???? - ??? ????? ?? ???????? ?????? ? ?????????? ? ?????
?? ?????????
25??????? ?? ????????? (probing)
- ??????? ?? ????? ????????? ???????
- ??????
- ???????? ?? ? AppBase
- ??????? ?? ?? AppName
?????? ? ???????????????? ????
AppBase\AppName.dll AppBase\AppName\AppName.dll Ap
pBase\privatePath1\AppName.dll AppBase\privatePath
1\AppName\AppName.dll AppBase\privatePath2\AppName
.dll AppBase\privatePath2\AppName\AppName.dll (???
?? ?????? ???????, ?? ? ?????????? exe)
26??????? ?? ????????? ?????????
- ????????? ????????? ????????? ??? ????????
???????, ???????? ?? ????????????? - ??????
- ???????? ?? ? AppBase
- ??????? ?? ?? AppName
AppBase\EN-US\AppName.dll AppBase\EN-US\AppName\Ap
pName.dll AppBase\EN-US\privatePath1\AppName.dll A
ppBase\EN-US\privatePath1\AppName\AppName.dll AppB
ase\EN-US\privatePath2\AppName.dll AppBase\EN-US\p
rivatePath2\AppName\AppName.dll (????? ??????
???????, ?? ? ?????????? exe)
27??????????????? ???????
- App.exe.config
- ????????? ??
- ?? ??????????????
- ?? ????????????? ?? ??????
- ?? ??????? ?? ??????
- ?????? ?? ?? ??????? ?????? ? ?????????? (Windows
Registry)
28???????????? 6
29Assemblies and Deployment???????? ??!
????????
?????? ???????
???-????? www.gis-sofia.bg Microsoft Student
Consultant www.fmi.uni-sofia.bg/microsoft/
30??????
31?????????? ??????????
- MSDN Library, Object Serialization in the .NET
Frameworkhttp//msdn.microsoft.com/library/defaul
t.asp?url/library/en-us/dndotnet/html/objserializ
.asp?frametruehidetoctrue - MSDN Library, System.Runtime.Serialization
Namespacehttp//msdn.microsoft.com/library/defaul
t.asp?url/library/en-us/cpref/html/frlrfsystemrun
timeserialization.asp?frametruehidetoctrue - MSDN, System.Runtime.Serialization.Formatters
Namespacehttp//msdn.microsoft.com/library/defaul
t.asp?url/library/en-us/cpref/html/frlrfsystemrun
timeserializationformatters.asp?frametruehidetoc
true - MSDN, System.Runtime.Serialization.Formatters.Bina
ry Namespacehttp//msdn.microsoft.com/library/def
ault.asp?url/library/en-us/cpref/html/frlrfsystem
runtimeserializationformattersbinary.asp?frametru
ehidetoctrue - MSDN, System.Runtime.Serialization.Formatters.Soap
Namespacehttp//msdn.microsoft.com/library/defau
lt.asp?url/library/en-us/cpref/html/frlrfsystemru
ntimeserializationformatterssoap.asp?frametruehi
detoctrue - MSDN, System.Xml.Serialization Namespacehttp//ms
dn.microsoft.com/library/default.asp?url/library/
en-us/cpref/html/frlrfsystemxmlserialization.asp?f
rametruehidetoctrue
32?????????? ??????????
- MSDN Library, How Do I...Create an assembly with
a strong name?http//samples.gotdotnet.com/quicks
tart/howto/doc/sharedname.aspx - MSDN Library, How Do I...Create a delay signed
shared assembly?http//samples.gotdotnet.com/quic
kstart/howto/doc/delaysign.aspx - MSDN Library, How Do I...Work with the global
assembly cache?http//samples.gotdotnet.com/quick
start/howto/doc/gac.aspx - MSDN Library, How Do I...Change the search path
for private assemblies?http//samples.gotdotnet.c
om/quickstart/howto/doc/searchpath.aspx - MSDN Library, How Do I...Use Assembly Version
Policy?http//samples.gotdotnet.com/quickstart/ho
wto/doc/Version.aspx
33?????????? ??????????
- MSDN Library, How Do I...Create a Publisher
Policy Assembly?http//samples.gotdotnet.com/quic
kstart/howto/doc/pubpolicy.aspx - MSDN Library, Packaging and Deploying .NET
Framework Applicationshttp//msdn.microsoft.com/l
ibrary/default.asp?url/library/en-us/cptutorials/
html/packaging_and_deploying__net_framework_applic
ations.asp - Configuration File Schemahttp//msdn.microsoft.co
m/library/default.asp?url/library/en-us/cpgenref/
html/gngrfnetframeworkconfigurationfileschema.asp - Ildasm.exe Tutorialhttp//msdn.microsoft.com/libr
ary/default.asp?url/library/en-us/cptutorials/htm
l/il_dasm_tutorial.asp
34?????????? ??????????
- .NET Framework Reference Documentationhttp//msdn
.microsoft.com/netframework/support/documentation/
default.aspx?pull/library/en-us/netstart/html/cpf
rameworkref_start.asp - Glossaryhttp//msdn.microsoft.com/netframework/su
pport/documentation/default.aspx?pull/library/en-
us/netstart/html/cpframeworkref_start.asp - Assemblieshttp//msdn.microsoft.com/library/defau
lt.asp?url/library/en-us/cpguide/html/cpconassemb
lies.asp