You have two assemblies named Assembly1 and Assembly2 that are written in C#. Assembly1 loads Assembly2 by executing the following code.
You create a new project in Microsoft Visual Studio to build a new assembly that will replace Assembly2. The new assembly has the same name and version as the original Assembly2 assembly.
When you execute the code, Assembly1 cannot load Assembly2.
What should you do to ensure that Assembly1 can load Assembly2?
Answer : C
You are developing an application that produces an executable named MyApp.exe and an assembly named MyApp.dll.
The application will be sold to several customers.
You need to ensure that enough debugging information is available for MyApp.exe, so that if the application throws an error in a customer's environment, you can debug the error in your own development environment.
What should you do?
Answer : B
A program database (PDB) file holds debugging and project state information that allows incremental linking of a debug configuration of your program. A PDB file is created when you build with /debug.
You are debugging an application that calculates loan interest. The application includes the following code. (Line numbers are included for reference only.)
You need to ensure that the debugger breaks execution within the CalculateInterest() method when the loanAmount variable is less than or equal to zero in all builds of the application.
What should you do?
Answer : A
Incorrect:
Not B: Debug.Assert only works in debug mode. Here it must work in all builds of the application.
You are developing an application that will parse a large amount of text.
You need to parse the text into separate lines and minimize memory use while processing data.
Which object type should you use?
Answer : C
There are many ways to separate a string into lines. With StringReader, we read lines from a string individually in the order they appear. This type enables us to access string data through a stream-oriented interface.
You are modifying an application that processes leases. The following code defines the Lease class. (Line numbers are included for reference only.)
Leases are restricted to a maximum term of 5 years. The application must send a notification message if a lease request exceeds 5 years.
You need to implement the notification mechanism.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
Answer : A, B
You are developing an application that includes a class named Order. The application will store a collection of Order objects.
The collection must meet the following requirements:
* Use strongly typed members.
* Process Order objects in first-in-first-out order.
* Store values for each Order object.
* Use zero-based indices.
You need to use a collection type that meets the requirements.
Which collection type should you use?
Answer : A
Queues are useful for storing messages in the order they were received for sequential processing. Objects stored in a Queue<T> are inserted at one end and removed from the other.
You are developing an application.
You need to declare a delegate for a method that accepts an integer as a parameter, and then returns an integer.
Which type of delegate should you use?
Answer : C
The Func<T, TResult> delegate encapsulates a method that has one parameter and returns a value of the type specified by the TResult parameter.