Top 100 ASP.NET Core Interview Questions and Answers for 2024 PART - 4

Top 100 ASP.NET Core Interview Questions and Answers for 2024 PART - 4

 


2331.)  What is Delay signing?

 

- Delay signing is a technique used during development to defer the generation of a full strong name for an assembly until it is ready for deployment.

- It allows developers to work with assemblies without requiring access to the full key pair used for strong naming.

 

2632.) What is GAC?

 

- GAC (Global Assembly Cache) is a machine-wide repository in the .NET framework for storing shared assemblies.

- It provides a centralized location for storing and sharing assemblies across multiple applications on the same system.

 

2733.) How to add and remove an assembly from GAC?

 

- Assemblies can be added to the GAC using the Gacutil.exe tool provided by the .NET framework.

- To remove an assembly from the GAC, you can use the same tool with the /u flag followed by the assembly name.

 

34.) If we have two versions of the same assembly in GAC how do we make a choice?

 

- The CLR uses a versioning policy to determine which version of an assembly to load from the GAC.

- By default, the CLR loads the highest available version of the assembly unless a specific version is specified

 

 

2835.) What is Reflection and why we need it?

 

- Reflection is a powerful feature in .NET that allows code to inspect and manipulate the structure of types, members, and objects at runtime.

- It provides the ability to dynamically load assemblies, create instances of types, invoke methods, and access fields and properties, even if they are private.

- Reflection is essential for building dynamic and extensible applications, enabling features such as plugin systems, serialization, and dynamic code generation.

 

2936.) How do we implement reflection?

 

- Reflection is implemented using classes from the System. Reflection namespace in. NET.

- Developers can use classes like Type, MethodInfo, PropertyInfo, and FieldInfo to introspect and manipulate types and members at runtime.

- Reflection involves querying type information, accessing members, and invoking methods dynamically based on runtime conditions.

 

3037.) What are the practical uses of reflection?

 

- Dynamic code generation and execution

- Serialization and deserialization of objects

- Dependency injection and inversion of control containers

- Custom attribute-based metadata processing

- Building extensible frameworks and plugins

 

3138.) What is the use of the Dynamic keyword?

 

- The dynamic keyword in C# enables dynamic typing, allowing variables to hold values of any type at runtime.

- It defers type checking until runtime, providing flexibility in scenarios where the type of an object is not known until runtime.

 

3239.) What are the practical uses of Dynamic keywords?

 

- Interacting with dynamic languages like JavaScript or Python

- Working with COM objects and dynamic APIs

- Parsing dynamic data structures like JSON or XML

 

3340.) What is the difference between Reflection and Dynamic?

 

- Reflection is a mechanism for inspecting and manipulating types, members, and objects at runtime, whereas dynamic is a type in C# that enables dynamic typing and late binding.

 

3441.) Explain the difference between early binding and late binding?

 

- Early binding (also known as static binding) occurs at compile time, where method calls and type resolutions are resolved before the program is executed.

- Late binding (also known as dynamic binding) occurs at runtime, where method calls and type resolutions are deferred until the program is executed, typically using reflection or dynamic typing.