Midterm2024 Flashcards

(45 cards)

1
Q

What are assemblies?

A

.NET software components

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are contained in assemblies?

A

Code compiled to CIL format

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is CIL?

A

Common Intermediate Language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which assembly includes the executable file?

A

Top-level client

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What file format is a library?

A

.dll

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is reflection?

A

Obtaining metadata from assembly at runtime

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the manifest?

A

High-level metadata about an assembly

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the manifest describe?

A
  1. Relationships and dependencies
  2. Versioning
  3. Scope
  4. Security permissions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What tool is used to look at an assembly’s metadata?

A

ildasm.exe

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What two ways does the CLR perform Assembly Binding?

A
  1. CoreCLR learns about assembly from manifest (requires project reference)
  2. CoreCLR instructed to load library in a line in client code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you specify a location for a library?

A

.json configuration file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Where is the default location for a library?

A

Client folder

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the difference between how the CLR loads a client assembly vs a library assembly?

A

Client assembly gets dedicated RAM, library shares the same RAM as the client it belongs to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Can two clients share the same library object?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a signed assembly?

A

Fully-Qualified or Strong name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What elements are included in an assembly name?

A
  • Name of the assembly
  • Version number
  • Cultural localization
  • Public key value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What does a strong name include?

A

Embedded digital signature with a hash of the assembly’s contents encrypted with the private key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is meant by “the lifetime of a managed object is nondeterministic”?

A

Garbage Collector automatically releases the memory of objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What must be added to the code of an unmanaged resource?

A

Finalization code

20
Q

How do you implement a dispose pattern?

A

Implement IDisposable
Override Dispose() method

21
Q

How do you implement a Finalize method?

A

Create a destructor

22
Q

What symbol denotes a destructor?

23
Q

What does a destructor compile to?

24
Q

What 2 things are attributes used for?

A
  1. Tell compiler to add some code
  2. Tell compiler to compile components differently
25
What are 2 use cases for serialization?
1. Object persistence 2. Remote Marshalling
26
What is Late-Binding?
Client gets type information about a library assembly at runtime
27
What must a programmer do to use late-binding?
Don't add a reference at design time
28
What is the difference between .NET Core and .NET Framework?
Core is cross-platform, Framework is Windows
29
What is Xamarin?
.NET for mobile platforms
30
What is CLR?
Common Language Runtime
31
What is unmanaged code?
Code that compiles to machine language
32
What is managed code?
Code that is compiled to CIL
33
What is CoreFX?
Library of foundation classes provided by .NET
34
What are 5 services provided by the CLR to managed applications?
1. Just in Time (JIT) translation 2. Assembly binding 3. Garbage collection 4. Dynamic type safety 5. Thread management
35
What is the difference between chunky and chatty interfaces?
Chatty has many small methods, chunky clusters behaviours into larger methods
36
What is a stateless object?
Object doesn't hold any data that is specific to a particular client or context
37
What is the key for the json config file to change where the CLR looks for library assemblies?
additionalProbingPaths
38
What is COM?
Component Object Model
39
What is the difference between COM and CLR components?
COM are unmanaged and have no intermediary between them and the OS
40
What kind of assembly allows COM libraries to integrate with .NET?
Runtime Callable Wrapper (RCW)
41
What kind of assembly allows a .NET component to mimic COM objects?
COM Callable Wrapper (CCW)
42
What is the prefix of a RCW file?
Interop
43
What is the file extension of a CCW file?
.tlb
44
What is the file extension of a NuGet file?
.nupkg
45
How do you generate a NuGet package?
Project Properties > Package > Check Generate NuGet package checkbox