CRR0031 - The returned Task is null May 06, 2018 This analyzer detects the asynchronous methods that return null. A Task-typed method returning null may appear after refactoring and causes the NullReferenceException when the method is called with the await keyword. C# VB.NET Task<string> DemoMethodAsync(CancellationToken token) { DoThings(); return null; } Private Function DemoMethodAsync(token As CancellationToken) As Task(Of String) DoThings() Return Nothing End Function You should construct a Task from null and return it to fix this issue. C# VB.NET Task<string> DemoMethodAsync(CancellationToken token) { DoThings(); return Task.FromResult<string>(null); } Private Function DemoMethodAsync(ByVal token As CancellationToken) As Task(Of String) DoThings() Return Task.FromResult(Of String)(Nothing) End Function