.NET Application Development Flashcards
6 cards from real MCTS practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 .NET Application Development flashcards as text
A developer needs to ensure that a compiled .NET assembly can be shared across multiple applications on a single machine. Which of the following is a mandatory prerequisite for deploying an assembly to the Global Assembly Cache (GAC)?
Answer: The assembly must have a strong name.
To be installed in the Global Assembly Cache (GAC), an assembly must have a strong name. A strong name consists of the assembly's identity—its simple text name, version number, and culture information (if provided)—plus a public key and a digital signature. This ensures the uniqueness of the assembly and prevents conflicts.
In the context of the .NET garbage collector, which generation is collected most frequently and contains newly allocated, short-lived objects?
Answer: Generation 0
The .NET garbage collector uses a generational approach to optimize performance. New objects are allocated in Generation 0. The GC collects Generation 0 most frequently because most objects are short-lived and can be reclaimed quickly. Objects that survive a Generation 0 collection are promoted to Generation 1, and those that survive a Generation 1 collection move to Generation 2.
A developer is building an ASP.NET Web Forms application and needs to programmatically create and add dynamic controls to a page. In which of the following page life cycle events is it most appropriate to create these controls to ensure their view state is correctly managed on subsequent postbacks?
Answer: PreInit
The PreInit event is the earliest stage in the page life cycle where it is appropriate to create dynamic controls. Creating controls this early ensures they are part of the page's control tree and can properly participate in the rest of the life cycle, including the loading of view state and postback data.
What is the primary role of the Common Intermediate Language (CIL) in the .NET Framework?
Answer: To serve as a common, platform-independent instruction set that all .NET languages compile into.
Common Intermediate Language (CIL), formerly known as MSIL, is the low-level, platform-independent instruction set into which all .NET source code (from languages like C#, VB.NET, etc.) is compiled. This CIL code is later compiled into native machine code by the Just-In-Time (JIT) compiler at runtime, enabling language interoperability and platform independence.
You are developing a Windows Presentation Foundation (WPF) application and need to define a custom property for a UserControl that supports data binding, styling, and animation. Which type of property should you implement?
Answer: A dependency property.
Dependency properties are a specific type of property system provided by WPF. They are required for a property to support features like data binding, styling, animation, and property value inheritance. Standard CLR properties do not have this built-in infrastructure.
A developer is working on a data access layer using ADO.NET and needs to work with a disconnected, in-memory representation of data retrieved from a database. Which ADO.NET object is best suited for this scenario?
Answer: DataSet
The DataSet is designed specifically for disconnected data access. It can hold multiple tables, relationships, and constraints, all in memory. This allows an application to retrieve data from a source, close the connection, and then work with the data locally before potentially reconnecting to update the source. A DataReader, in contrast, provides a forward-only, connected stream of data.