Monday, February 27, 2017

C# - if await is missing, async method go into an unpredictable state - result: Exception

In C#,
if you plan to use async functions and wait for their results using await, you're going to be ok.

However, if you forget await in a call, and try to use results of the async operation , you're probably going to see NullReferenceException or something similar. Visual Studio warns about these situation by issuing a green line where await (or Task.Wait) is missing.

No comments:

Post a Comment

Ubuntu 12.04, 14.04, 16.04 - auto start an app or script before login

To run a command or application at startup, even before the user has logged in, you can use this file: /etc/rc.local The commands entered...