Saturday, February 16, 2008

C# - Assembly Questions

1. How is the DLL Hell problem solved in .NET? Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly.
2. What are the ways to deploy an assembly? An MSI installer, a CAB archive, and XCOPY command.
3. What is a satellite assembly? When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies.
4. What namespaces are necessary to create a localized application? System.Globalization and System.Resources.
5. What is the smallest unit of execution in .NET?an Assembly.
6. When should you call the garbage collector in .NET?As a good rule, you should not call the garbage collector. However, you could call the garbage collector when you are done using a large object (or set of objects) to force the garbage collector to dispose of those very large objects from memory. However, this is usually not a good practice.
7. How do you convert a value-type to a reference-type?Use Boxing.
8. What happens in memory when you Box and Unbox a value-type?Boxing converts a value-type to a reference-type, thus storing the object on the heap. Unboxing converts a reference-type to a value-type, thus storing the value on the stack.