exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 1 question 66 discussion

Actual exam question from Microsoft's 70-483
Question #: 66
Topic #: 1
[All 70-483 Questions]

You use the Task.Run() method to launch a long-running data processing operation. The data processing operation often fails in times of heavy network congestion.
If the data processing operation fails, a second operation must clean up any results of the first operation.
You need to ensure that the second operation is invoked only if the data processing operation throws an unhandled exception.
What should you do?

  • A. Create a task within the operation, and set the Task.StartOnError property to true.
  • B. Create a TaskFactory object and call the ContinueWhenAll() method of the object.
  • C. Create a task by calling the Task.ContinueWith() method.
  • D. Use the TaskScheduler class to create a task and call the TryExecuteTask() method on the class.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️
Task.ContinueWith - Creates a continuation that executes asynchronously when the target Task completes. The returned Task will not be scheduled for execution until the current task has completed, whether it completes due to running to completion successfully, faulting due to an unhandled exception, or exiting out early due to being canceled.
References: http://msdn.microsoft.com/en-us/library/dd270696.aspx

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
rosdra
Highly Voted 5 years, 4 months ago
And should add TaskContinuationOptions.OnlyOnFaulted => "Specifies that the continuation task should be scheduled only if its antecedent threw an unhandled exception"
upvoted 15 times
mmarinov
5 years, 1 month ago
I agree with you. The provided answer is not full
upvoted 6 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...