AOP – using PostSharp attributes with async Task/Task<T> methods

NOTE: if you’re unfa­mil­iar with how Post­Sharp works under the hood, I high­ly rec­om­mend that you check out Dustin Davis’ excel­lent Post­Sharp Prin­ci­ples series of blog posts here. The Prob­lem The new async/await key­words in C# are pret­ty awe­some, and makes life an awful lot eas­i­er when writ­ing asyn­chro­nous and non-block­­ing IO code. How­ev­er, for …

AOP – using Post­Sharp attrib­ut­es with async Task/Task<T> meth­odsRead More »

C# – beware of async void in your code

In gen­er­al, when you see async void in your code it’s bad news, because: you can’t wait for its com­ple­tion (as men­tioned in this post already) any unhan­dled excep­tions will ter­mi­nate your process (ouch!)   Sup­pose you have a timer event that fires every once in a while and you want to do some asyn­chro­nous …

C# – beware of async void in your codeRead More »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.