Mar 2016 updated: Testking Microsoft 70-518 exam question 91-105

Question No. 91

You are designing a distributed Windows Presentation Foundation (WPF) application. You have the following requirements: 

Ensure that all errors are logged in a central location. 

Ensure that the WPF application logs related errors within a single transaction. 

Secure error information during transmission. 

You need to recommend a strategy for collecting error information. 

What should you recommend? 

A. Write the information to the Windows Application log on each client system. Use Windows Error Reporting to collect the results. 

B. Write the information to the Windows Application log on each client system. Use Windows Management Instrumentation (WMI) to collect the results. 

C. Create a Windows Communication Foundation (WCF) service. Use the basicHttpBinding protocol to transport the information. 

D. Create a Windows Communication Foundation (WCF) service. Use the wsHttpBinding protocol to transport the information. 

Answer:


Question No. 92

You are developing an application by using Microsoft .NET Framework 4 and Microsoft Visual Studio 2010. 

The application contains a grid that displays customer data stored in a database table. 

Users report that the grid takes a long time to display. 

You plan to implement data caching to improve loading time for the grid. 

You need to ensure that the cached data expires when the customer data is updated. 

What should you do? 

A. Use the System.Web.Caching.CacheDependency class. 

B. Use the System.Runtime.Caching.SqlChangeMonitor class. 

C. Use the ADO.NET Entity Framework. 

D. Use a static variable to store the Grid object. 

Answer:


Question No. 93

You are designing a Windows Presentation Foundation (WPF) application that uses .NET Framework 4. The application uses a subset of the functionality provided by a third-party COM component that will be replaced later. 

The application developers must have access to only the required subset of functionality. 

You need to recommend a solution that meets the requirements. 

Which two actions should you recommend? (Each correct answer presents part of the solution. Choose two.) 

A. Create an adapter assembly that exposes the entire functionality of the COM component. 

B. In the adapter assembly, use an embedded interop reference. 

C. In the adapter assembly, use a standard interop reference. 

D. Create an adapter assembly that exposes the required subset of the COM component functionality. 

Answer: CD 


Question No. 94

You are developing a Windows application by using Microsoft .NET Framework 4 and Microsoft Visual Studio 2010. 

The application will consume a Windows Communication Foundation (WCF) service. The WCF service will provide data to the application. You plan to use the ADO.NET Entity Framework to create a data model that will be used by the application. 

Another development team makes changes to the WCF service data contract. 

You need to ensure that changes made to the WCF service data contract do not require the application to be recompiled. 

What should you do? 

A. Create a conceptual model and a storage model based on the existing version of the WCF service. 

B. Create a storage model based on the business model. Use a class generated from the storage model for programming. 

C. Create a storage model based on the schema of the existing WCF service. Update the mapping file when the new version of the WCF service is available. 

D. Create a conceptual model based on the business model. Use a class generated from the conceptual model for programming. Update the mapping file when the new version of the WCF service is available. 

Answer:


Question No. 95

You are working with an existing Windows Presentation Foundation (WPF) application in Microsoft Visual Studio 2010. The WPF application requires approximately one minute to initialize before displaying its main window. 

You have the following requirements: 

Immediately display a splash screen when the WPF application launches. 

Allow for the display of an initialization progress bar on the splash screen. 

Close the splash screen when the WPF application is ready to display the main window. 

You need to recommend an approach for meeting the requirements. 

What should you recommend? 

A. Move the initialization code to the code-behind of the main window. 

B. Launch a custom splash screen by using a Window object. When the initialization completes, launch the main window from the splash screen. 

C. Create a SplashScreen object. Display the object in the code-behind of the App.xaml file. 

D. Compile an image into the WPF application with a Build Action value of SplashScreen. 

Answer:


Question No. 96

You are designing a .NET Framework 4 solution that contains a Windows Presentation Foundation (WPF) application and a Windows Communication Framework (WCF) Web service. The WPF application will be deployed to users' desktops located in the company's corporate network. The WCF Web service will be deployed to a Web farm located in the company's perimeter network. The firewall between the perimeter network and the Internet allows only HTTP and HTTPS traffic. 

You need to recommend an approach for minimizing the attack surface of the WCF Web service. 

What should you recommend? 

A. Add a load-balancing router to the Web farm configuration. 

B. Configure a WCF endpoint to use the basicHttpBinding binding. 

C. Configure a WCF endpoint to use the NetTcpBinding binding. 

D. Set up an SSL certificate on the server. 

Answer:


Question No. 97

An existing Windows application uses a Windows Communication Foundation (WCF) Web service that is available only to employees. 

You have the following requirements: 

Make the WCF Web service available to business partners. 

Enable business partners to send a profile token. 

Ensure that the currently deployed application continues to function. 

You need to recommend a solution that meets the requirements. 

What should you recommend? 

A. Convert the WCF Web service to a Duplex service that implements a callback to accept the profile token. 

B. Use SOAP headers to pass the profile token to the service operations. 

C. Modify the WCF Web service operations to accept the profile token as an additional parameter. 

D. Implement the WCF Web service as a REST service. 

Answer:


Question No. 98

You are reviewing an existing Windows application that uses .NET Framework 4. 

When the user clicks a button, the application sequentially processes thousands of image files contained in a directory. The user interface becomes unresponsive while the application processes the files. 

You have the following requirements: 

Modify the button's click event. 

Increase application throughput by processing multiple image files concurrently. 

Guaranteed success with TestInsides practice guides 

. Ensure that the user interface remains responsive while the application processes the image files. 

You need to recommend an approach for meeting the requirements. 

What should you recommend? 

A. Iterate over the image files by using the Parallel.ForEach() method. For each image file, start a separate thread that processes the image file, by using the Thread.Start() method. 

B. Iterate over the image files. For each image file, use the Process.Start() method to launch a console application that processes the image file. 

C. Use the Parallel.ForEach() method to process the images concurrently. 

D. Use the ThreadPool.QueueUserWorkItem() method to queue up a single work item that uses the Parallel.ForEach () method to process the image files concurrently. 

Answer:


Question No. 99

You are designing a Windows Presentation Foundation (WPF) application. 

The application calls methods that perform long-running computational tasks. 

You need to recommend an approach for ensuring that the application remains responsive while the tasks are executing. 

What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.) 

A. Use synchronous method calls from a thread other than the thread on which the user interface runs. 

B. Run the user interface from a new multi-threaded apartment (MTA) thread. 

C. Use synchronous method calls from the user interface thread. 

D. Use asynchronous method calls from the user interface thread. 

Answer: AD 


Question No. 100

You are developing an application by using Microsoft .NET Framework 4. 

The application will be used by all employees of your company, Local file stores on the computers are secure and inaccessible remotely. 

You need to design a remote monitoring strategy to monitor the usage time of the application by each user. 

What should you do? 

A. Create a TraceLog object and the Trace object by using the System.Diagnostics element to trace startup, shutdown, and user idle time events throughout the application. 

B. Create a TraceLog object by using the System.Diagnostics element in the application configuration file. Add the TraceSource element for startup, shutdown, and user idle time events. 

C. Use the System.Management.Instrumentation namespace to publish startup, shutdown, and user idle time events of the application. Publish the events to Microsoft Operations Manager. 

D. Use the System.Management.Instrumentation namespace to issue event queries against methods that pass ProgressEvent and StoppedEvent arguments. Publish the events to the Event Log. 

Answer:


Question No. 101

You have developed a Windows application by using Microsoft .NET Framework 4, Windows Presentation Foundation (WPF), and Microsoft SQL Server 2008. 

The application is deployed as an XAML Browser Application (XBAP) and executes in the Internet Zone in Internet Explorer. The application updates data in a SQL Server 2008 database. 

Users report that a SecurityException exception occurs when the application attempts to save data to the database. 

You need to design a solution to resolve the problem. 

What should you do? 

A. Redesign the XBAP application by using partial trust. 

B. Redesign the XBAP code to utilize stored procedures. 

C. Design a WCF Service tier to provide database access. 

D. Design a data access layer that uses ASP.NET Entity Framework to communicate with the database by using the System.Data.SqICIient class. 

Answer:


Question No. 102

You are designing an application by using Microsoft NET Framework 4 and Microsoft Visual Studio 2010. 

Your development team consists of designers and C# developers. 

. You need to ensure that the application meets the following requirements: 

. Kit allows separation of user interface (UI) code and business logic. 

. "It allows the UI to be data-bound without requiring a code-behind file. 

Which technology should you use? 

A. Windows Forms along with Model View Presenter (MVP) 

B. Windows Forms without Model View Presenter (MVP) 

C. Windows Presentation Foundation (WPF) along with Model-View-View Model (M-V-VM) 

D. Windows Presentation Foundation (WPF) without Model-View-View Model (M-V-VM) 

Answer:


Question No. 103

You are designing an application by using Microsoft .NET Framework 4 and Microsoft Visual Studio 2010. The application will store data that includes a time and date stamp. 

The middle tier of the application is implemented by using Windows Communication Foundation (WCF). The middle tier connects to geographically separated database servers. 

You need to ensure that the application meets the following requirements; 

. Data stored contains time and date information local to the database server. 

. Data stored contains Universal Coordinated Time (UTC). 

Which class should you use? 

A. DateTime 

B. TimeZone 

C. DateTimeOffset 

D. TimeZonelnfo 

Answer:


Question No. 104

You design a Windows Presentation Foundation (WPF) application that interacts with a Windows Communication Foundation (WCF) Web service. The WCF Web service throws exceptions of type Exception. 

The WPF application crashes when the WCF Web service throws an exception. 

You need to recommend an error-handling strategy that allows users to submit updated data to the WCF Web service without restarting the WPF application. 

What should you recommend? 

A. Modify the Web service to throw exceptions of type FaultException. 

B. Modify the Web service to throw custom exceptions derived from the Exception class. 

C. Modify the Web service to throw exceptions of type InvalidOperationException. 

D. Modify the Web service to throw custom exceptions derived from the ApplicationException class. 

Answer:


Question No. 105

You are designing an application by using Microsoft .NET Framework 4 and Microsoft Visual Studio 2010. 

The application includes Windows Workflow Foundation (WF) hosts that run thousands of workflow instances. Workflows usually take 2 hours of time to complete. The application also includes a Windows Communication Foundation (WCF) service that contains a method to check the completion status of a workflow stored in a database. 

External applications that use the WCF service to check the status of workflows every minute causes performance degradation of the workflow that hosts the application. 

You need to eliminate the performance degradation caused by workflow status checks. 

What should you do? 

A. . Cache the status of the workflow. 

. Assign a callback function based on a SqlDependencyobject. 

. Reload the cache in the callback function. 

B. . Cache the status of the workflow. 

. Set the expiry time of the Cache object to 30 minutes. 

C. . Create a status checking workflow. 

. Return the status of the original workflow to the external application in 30 minute intervals. 

D. . Create a status checking workflow. 

. Return the status of the original workflow to the external application after 10 requests have been made. 

Answer: