Midterm2024 Flashcards
(45 cards)
What are assemblies?
.NET software components
What are contained in assemblies?
Code compiled to CIL format
What is CIL?
Common Intermediate Language
Which assembly includes the executable file?
Top-level client
What file format is a library?
.dll
What is reflection?
Obtaining metadata from assembly at runtime
What is the manifest?
High-level metadata about an assembly
What does the manifest describe?
- Relationships and dependencies
- Versioning
- Scope
- Security permissions
What tool is used to look at an assembly’s metadata?
ildasm.exe
What two ways does the CLR perform Assembly Binding?
- CoreCLR learns about assembly from manifest (requires project reference)
- CoreCLR instructed to load library in a line in client code
How do you specify a location for a library?
.json configuration file
Where is the default location for a library?
Client folder
What is the difference between how the CLR loads a client assembly vs a library assembly?
Client assembly gets dedicated RAM, library shares the same RAM as the client it belongs to
Can two clients share the same library object?
No
What is a signed assembly?
Fully-Qualified or Strong name
What elements are included in an assembly name?
- Name of the assembly
- Version number
- Cultural localization
- Public key value
What does a strong name include?
Embedded digital signature with a hash of the assembly’s contents encrypted with the private key
What is meant by “the lifetime of a managed object is nondeterministic”?
Garbage Collector automatically releases the memory of objects
What must be added to the code of an unmanaged resource?
Finalization code
How do you implement a dispose pattern?
Implement IDisposable
Override Dispose() method
How do you implement a Finalize method?
Create a destructor
What symbol denotes a destructor?
~
What does a destructor compile to?
Finalize()
What 2 things are attributes used for?
- Tell compiler to add some code
- Tell compiler to compile components differently