nerdexam
Microsoft

70-516 · Question #220

You are developing a Microsoft .NET Framework 4 application. You need to collect performance data to the event log after the application is deployed to the production environment. Which two…

The correct answer is B. A debug listener C. Debug.Asset() statements. Tracing is a way for you to monitor the execution of your application while it is running. For example, suppose you set up two listeners: a TextWriterTraceListener and an EventLogTraceListener. Each listener receives the same message. The TextWriterTraceListener would direct…

Deploying and Troubleshooting Data Access

Question

You are developing a Microsoft .NET Framework 4 application. You need to collect performance data to the event log after the application is deployed to the production environment. Which two components should you include in the project? (Each correct answer presents part of the solution. Choose two.)

Exhibit

70-516 question #220 exhibit

Options

  • AA trace listener
  • BA debug listener
  • CDebug.Asset() statements
  • DDebug.WriteLine() statements
  • ETrace.WriteLine() statements

How the community answered

(45 responses)
  • A
    2% (1)
  • B
    78% (35)
  • D
    13% (6)
  • E
    7% (3)

Explanation

Tracing is a way for you to monitor the execution of your application while it is running. For example, suppose you set up two listeners: a TextWriterTraceListener and an EventLogTraceListener. Each listener receives the same message. The TextWriterTraceListener would direct its output to a stream, and the EventLogTraceListener would direct its output to an event log. The following example shows how to send output to the Listeners collection. // Use this example when debugging. System.Diagnostics.Debug.WriteLine("Error in Widget 42"); // Use this example when tracing. System.Diagnostics.Trace.WriteLine("Error in Widget 42"); You are updating an existing Microsoft .NET Framework 4 application that includes a data layer built with ADO.NET Entity Framework 4. The application communicates with a Microsoft SQL Server 2008 instance named INST01 on a server named SQL01. The application stores data in a database named Contoso in the INST01 instance. You need to update the existing technology and develop new functionality by using Microsoft Visual Studio 2010. Application and Data Structure The application tracks bicycle parts as they pass through a factory. Parts are represented by the abstract Part entity and its associated partial classes. Each part has a name stored in the Name field and a unique identifier stored in the Id field. Parts are either components (represented by the Component class) such as chains, wheels, and frames, or finished products (represented by the Product class) such as completed bicycles. The Component class and the Product class derive from the Part class and may contain additional class-specific properties. Parts may have a color (represented by the Color class), but not all parts have a color. Parts may be composed of other parts, and those parts may in turn be composed of other parts; any part represents a tree of the parts that are used to build it. The lowest level of the tree consists of components that do not contain other components. A product is a part that has been completed and is ready to leave the factory. A product typically consists of many components (forming a tree of child parts) but can also be constructed by combining other products and/or components to form a bundled product, such as a bicycle and a helmet that are sold together. Components and products are stored in a database table named Parts by using a table-per- hierarchy (TPH) mapping. Components have a null ProductType field and a non-null PartType field. Products have a non-null ProductType field and a null PartType field. The following diagram illustrates the complete Entity data model diagram (EDMX diagram). The following graphic illustrates details of the Part-Color Association. The following code segments show relevant portions of the files referenced by the case study items. (Line numbers in the samples below are included for reference only and include a two- character prefix that denotes the specific file to which they belong.) Extension Method.cs Model/component.cs Model ContosoEntities.cs Model/Product.cs

Topics

#trace listener#event log#production diagnostics#Trace.WriteLine

Community Discussion

No community discussion yet for this question.

Full 70-516 Practice