2017-04-18 07:52:04 +08:00
|
|
|
## Workflow now throws original exception instead of NullReferenceException in some cases
|
2017-04-06 04:52:19 +08:00
|
|
|
|
|
|
|
### Scope
|
|
|
|
Minor
|
|
|
|
|
|
|
|
### Version Introduced
|
|
|
|
4.7
|
|
|
|
|
|
|
|
### Source Analyzer Status
|
|
|
|
NotPlanned
|
|
|
|
|
|
|
|
### Change Description
|
2017-04-21 02:19:05 +08:00
|
|
|
|
|
|
|
In the .NET Framework 4.6.2 and earlier versions, when the Execute method of a
|
|
|
|
workflow activity throws an exception with a `null` value for the
|
|
|
|
<xref:System.Exception.Message> property, the
|
|
|
|
System.Activities Workflow runtime throws a
|
|
|
|
<xref:System.NullReferenceException?displayProperty=name>, masking the original
|
2017-04-06 04:52:19 +08:00
|
|
|
exception.
|
|
|
|
|
2017-04-18 05:32:21 +08:00
|
|
|
In the .NET Framework 4.7, the previously masked exception is thrown.
|
2017-04-06 04:52:19 +08:00
|
|
|
|
2017-04-18 05:32:21 +08:00
|
|
|
- [ ] Quirked
|
|
|
|
- [ ] Build-time break
|
2017-04-06 04:52:19 +08:00
|
|
|
|
|
|
|
### Recommended Action
|
2017-04-21 02:19:05 +08:00
|
|
|
|
|
|
|
If your code relies on handling the
|
|
|
|
<xref:System.NullReferenceException?displayProperty=name>, change it to catch
|
|
|
|
the exceptions that could be thrown from your custom activities.
|
2017-04-06 04:52:19 +08:00
|
|
|
|
|
|
|
### Affected APIs
|
2017-04-18 05:32:21 +08:00
|
|
|
* `M:System.Activities.CodeActivity.Execute(System.Activities.CodeActivityContext)`
|
|
|
|
* `M:System.Activities.AsyncCodeActivity.BeginExecute(System.Activities.AsyncCodeActivityContext,System.AsyncCallback,System.Object)`
|
|
|
|
* `M:System.Activities.AsyncCodeActivity`1.BeginExecute(System.Activities.AsyncCodeActivityContext,System.AsyncCallback,System.Object)`
|
2017-04-06 04:52:19 +08:00
|
|
|
* `M:System.Activities.WorkflowInvoker.Invoke`
|
|
|
|
|
|
|
|
### Category
|
2017-04-18 07:52:04 +08:00
|
|
|
Windows Workflow Foundation (WF)
|
|
|
|
|
|
|
|
<!-- breaking change id: 170 -->
|