Exam 70-536 : .NET Framework Application Development Foundation Part – 13

Question: You are developing an application that dynamically loads assemblies from an application directory. You need to write a code segment that loads an assembly named Company1.dll into the current application domain. Which code segment should you use?

Correct Answer: 1


Question: You are creating a class that uses unmanaged resources. This class maintains references to managed resources on other objects. You need to ensure that users of this class can explicitly release resources when the class instance ceases to be needed. Which three actions should you perform? (Each correct answer presents part of the solution. Choose three.)

  1. Define the class such that it inherits from the WeakReference class.
  2. Define the class such that it implements the IDisposable interface.
  3. Create a class destructor that calls methods on other objects to release the managed resources.
  4. Create a class destructor that releases the unmanaged resources.
  5. Create a Dispose method that calls System.GC.Collect to force garbage collection.
  6. Create a Dispose method that releases unmanaged resources and calls methods on other objects to release the managed resources.

Correct Answer: 2, 4 & 6


Question: You write a class named Employee that includes the following code segment.

You need to expose this class to COM in a type library. The COM interface must also facilitate forward-compatibility across new versions of the Employee class. You need to choose a method for generating the COM interface. What should you do?

  1. Add the following attribute to the class definition.
    [ClassInterface(ClassInterfaceType.None)]
    public class Employee {
  2. Add the following attribute to the class definition.
    [ClassInterface(ClassInterfaceType.AutoDual)]
    public class Employee {
  3. Add the following attribute to the class definition.
    [ComVisible(true)]
    public class Employee {
  4. Define an interface for the class and add the following attribute to the class
    definition.
    [ClassInterface(ClassInterfaceType.None)]
    public class Employee : IEmployee {

Correct Answer: 4


Question: You use Reflection to obtain information about a method named MyMethod. You need to ascertain whether MyMethod is accessible to a derived class. What should you do?

  1. Call the IsAssembly property of the MethodInfo class.
  2. Call the IsVirtual property of the MethodInfo class.
  3. Call the IsStatic property of the MethodInfo class.
  4. Call the IsFamily property of the MethodInfo class.

Correct Answer: 4


Question: You write the following code segment to call a function from the Win32 Application Programming Interface (API) by using platform invoke.

You need to define a method prototype that can best marshal the string data. Which code segment should you use?

Correct Answer: 3

Tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.